source: node_modules/es-toolkit/dist/compat/predicate/isBoolean.d.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Added visualizations

  • Property mode set to 100644
File size: 764 bytes
Line 
1/**
2 * Checks if the given value is boolean.
3 *
4 * This function tests whether the provided value is strictly `boolean`.
5 * It returns `true` if the value is `boolean`, and `false` otherwise.
6 *
7 * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `boolean`.
8 *
9 * @param {any} value - The Value to test if it is boolean.
10 * @returns {value is boolean} True if the value is boolean, false otherwise.
11 *
12 * @example
13 *
14 * const value1 = true;
15 * const value2 = 0;
16 * const value3 = 'abc';
17 *
18 * console.log(isBoolean(value1)); // true
19 * console.log(isBoolean(value2)); // false
20 * console.log(isBoolean(value3)); // false
21 *
22 */
23declare function isBoolean(value?: any): value is boolean;
24
25export { isBoolean };
Note: See TracBrowser for help on using the repository browser.