-
-
Notifications
You must be signed in to change notification settings - Fork 0
truthy
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isTruthy<U>(it: U): it is Exclude<U, Falsy>;
Name | Info |
---|---|
it |
The value to check. |
true
if the value is truthy, false
otherwise.
Primitives
import { isTruthy } from "jsr:@nick/is/truthy";
isTruthy(1); // true
isTruthy("foo"); // true
isTruthy(true); // true
isTruthy({}); // true
isTruthy(0); // false
isTruthy(""); // false
isTruthy(false); // false
isTruthy(null); // false
isTruthy(undefined); // false