diginext-utils
Version:
README.md
21 lines • 516 B
TypeScript
/**
* Converts a value to a boolean.
* Recognizes string representations like "true", "false", "0", "1".
*
* @param value - The value to convert
* @returns The boolean representation
*
* @example
* ```ts
* toBool('true'); // true
* toBool('false'); // false
* toBool('1'); // true
* toBool('0'); // false
* toBool(1); // true
* toBool(0); // false
* toBool(null); // false
* toBool(''); // false
* ```
*/
export declare function toBool(value: unknown): boolean;
//# sourceMappingURL=toBool.d.ts.map