Skip to content

assertTypeBoolean

Assert that a value is of type boolean, with type-narrowing.

import { assertTypeBoolean } from "@kensio/smartass";
const value: unknown = true;
assertTypeBoolean(value);
// value is now narrowed to boolean

Source file: src/assert/type-boolean/type-boolean.assert.ts