isBoolean es-toolkit
Checks if a value is a boolean type.
Usage
isBoolean(value)
Use isBoolean when you want to check if a value is exactly true or false. It acts as a type guard in TypeScript, narrowing the value's type to boolean.
Particularly useful when used as a type guard in TypeScript.
Can also be used for validating API responses or user input.
Parameters
valueunknownrequired
The value to check if it's a boolean type.
Returns
Returns true if the value is true or false, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.