Skip to content

isBool

isBool(val): boolean

Defined in: core/utils/types.ts:53

Returns true if the value is a boolean, or the string 'true' or 'false'.

The value goes through bool first, so the strings count. It is not a type guard for that reason: a true result does not mean typeof val === 'boolean'.

unknown

Value to test.

boolean