GuobaGuoba Utils

isBoolean

@guoba-ai/utils / guard / isBoolean

Function: isBoolean()

function isBoolean(val): val is boolean;

Defined in: guard.ts:53

Check if a value is a boolean.

Parameters

val

unknown

The value to check

Returns

val is boolean

true if the value is a boolean

Example

isBoolean(true) // true

isBoolean(false) // true

isBoolean(0) // false

On this page