remeda
Version:
A utility library for JavaScript and Typescript.
21 lines • 696 B
TypeScript
//#region src/isTruthy.d.ts
/**
* A function that checks if the passed parameter is truthy and narrows its type accordingly.
*
* @param data - The variable to check.
* @returns True if the passed input is truthy, false otherwise.
* @signature
* R.isTruthy(data)
* @example
* R.isTruthy('somethingElse') //=> true
* R.isTruthy(null) //=> false
* R.isTruthy(undefined) //=> false
* R.isTruthy(false) //=> false
* R.isTruthy(0) //=> false
* R.isTruthy('') //=> false
* @category Guard
*/
declare function isTruthy<T>(data: T): data is Exclude<T, "" | 0 | false | null | undefined>;
//#endregion
export { isTruthy };
//# sourceMappingURL=isTruthy-DEDXRpbk.d.ts.map