Skip to main content
Module

x/typestruct/mod.ts>boolean

Composable and checkable JavaScript (and TypeScript) data structure
Latest
function boolean
import { boolean } from "https://deno.land/x/typestruct@1.0.0-beta.5/mod.ts";

Create boolean data type struct.

Examples

Example 1

import { boolean, is } from "https://deno.land/x/typestruct@$VERSION/mod.ts";
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts";

assertEquals(is(boolean(), true), true);
assertEquals(is(boolean(), ""), false);

Parameters

optional
message: string | Messenger<DataTypeContext>

Custom issue message.

Returns

Struct<unknown, boolean>