Files
xLog/app/lib/utils.ts
T
2022-05-02 20:43:47 +08:00

6 lines
173 B
TypeScript

type Truthy<T> = T extends false | "" | 0 | null | undefined ? never : T // from lodash
export function truthy<T>(value: T): value is Truthy<T> {
return Boolean(value)
}