Skip to content

Commit 14b11c4

Browse files
committed
feat(common): add isNullish utility function to check for null or undefined values
1 parent a302423 commit 14b11c4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ export const entriesOf = <T extends Record<string, unknown>>(record: T) =>
44
Object.entries(record) as Array<[keyof T, T[keyof T]]>;
55

66
export const valuesOf = <T extends Record<string, unknown>>(record: T) => Object.values(record) as T[keyof T][];
7+
8+
export const isNullish = (value: unknown): value is null | undefined => value === null || value === undefined;

0 commit comments

Comments
 (0)