Skip to content

Commit

Permalink
feat(utilities): add Nullish utility type
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Jan 13, 2021
1 parent fb9ef18 commit a7e32bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/utilities/src/lib/utilityTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,8 @@ export type SecondArgument<T> = T extends (arg1: unknown, arg2: infer U, ...args
* ReturnType for a function that can return either a value or a `Promise` with that value
*/
export type Awaited<T> = PromiseLike<T> | T;

/**
* Type union for the full 2 billion dollar mistake in the JavaScript ecosystem
*/
export type Nullish = null | undefined;

0 comments on commit a7e32bd

Please sign in to comment.