remeda
Version:
A utility library for JavaScript and Typescript.
20 lines (17 loc) • 586 B
TypeScript
import { N as NarrowedTo } from './NarrowedTo-CDIykNaN.js';
import 'type-fest';
/**
* A function that checks if the passed parameter is a boolean and narrows its type accordingly.
*
* @param data - The variable to check.
* @returns True if the passed input is a boolean, false otherwise.
* @signature
* R.isBoolean(data)
* @example
* R.isBoolean(true) //=> true
* R.isBoolean(false) //=> true
* R.isBoolean('somethingElse') //=> false
* @category Guard
*/
declare function isBoolean<T>(data: T | boolean): data is NarrowedTo<T, boolean>;
export { isBoolean };