Skip to content

Commit 0ff3e76

Browse files
committed
feat: add isNothing()
1 parent 34fd86d commit 0ff3e76

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/immer.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
IProduceWithPatches,
44
Immer,
55
Draft,
6-
Immutable
6+
Immutable,
7+
NOTHING as nothing
78
} from "./internal"
89

910
export {
@@ -17,13 +18,14 @@ export {
1718
current,
1819
isDraft,
1920
isDraftable,
20-
NOTHING as nothing,
2121
DRAFTABLE as immerable,
2222
freeze,
2323
Objectish,
2424
StrictMode
2525
} from "./internal"
2626

27+
export {nothing}
28+
2729
const immer = new Immer()
2830

2931
/**
@@ -124,3 +126,7 @@ export {Immer}
124126
export {enablePatches} from "./plugins/patches"
125127
export {enableMapSet} from "./plugins/mapset"
126128
export {enableArrayMethods} from "./plugins/arrayMethods"
129+
130+
export function isNothing(value: unknown): value is typeof nothing {
131+
return value === nothing
132+
}

0 commit comments

Comments
 (0)