Skip to content

Commit 96d7011

Browse files
committed
Add AnyNonNullishValue helper type
1 parent 275f2c8 commit 96d7011

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/toolkit/src/tsHelpers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,13 @@ export function asSafePromise<Resolved, Rejected>(
221221
) {
222222
return promise.catch(fallback) as SafePromise<Resolved | Rejected>
223223
}
224+
225+
/**
226+
* An alias for type `{}`. Represents any value that is not
227+
* `null` or `undefined`. It is mostly used for semantic purposes
228+
* to help distinguish between an empty object type and `{}` as
229+
* they are not the same.
230+
*
231+
* @internal
232+
*/
233+
export type AnyNonNullishValue = NonNullable<unknown>

0 commit comments

Comments
 (0)