Last updated 1 year ago
type Falsy = | false | "" | 0 | -0 | 0n | -0n | null | undefined | void; function isFalsy(value: unknown): value is Falsy { return !value; } type Truthy<T> = Exclude<T, Falsy>; function isTruthy<T>(value: T): value is Truthy<T> { return !!value; }