Skip to content

assertcheck v1.0.0


assertcheck / assert / boolean

Function: boolean()

ts
function boolean(v, opts?): asserts v is boolean;

Defined in: src/assert.ts:284

Asserts that v is a boolean. Narrows the type after the call.

Parameters

ParameterType
vunknown
opts?Opts

Returns

asserts v is boolean

Example

ts
`assert.boolean(flag, "flag must be boolean")`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.