diff --git a/src/utils/common.ts b/src/utils/common.ts index 27a93845..c4df7027 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -10,7 +10,9 @@ import { ImmerState, hasMap, Archtype, - die + die, + NOTHING, + Nothing } from "../internal" /** Returns true if the given value is an Immer draft */ @@ -215,3 +217,7 @@ export function isFrozen(obj: any): boolean { // See #600, IE dies on non-objects in Object.isFrozen return Object.isFrozen(obj) } + +export function isNothing(value: unknown): value is Nothing { + return value === NOTHING +}