We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ecf46f commit 39ed05eCopy full SHA for 39ed05e
src/json-walk/__tests__/index.spec.ts
@@ -26,3 +26,36 @@ test('can walk through a value', () => {
26
3,
27
]);
28
});
29
+
30
+test('can walk through null', () => {
31
+ const value = null;
32
+ const nodes: unknown[] = [];
33
+ walk(value, (node) => {
34
+ nodes.push(node);
35
+ });
36
+ expect(nodes).toEqual([
37
+ null,
38
+ ]);
39
+});
40
41
+test('can walk empty object', () => {
42
+ const value = {};
43
44
45
46
47
48
+ {},
49
50
51
52
+test('can walk empty array', () => {
53
+ const value: any[] = [];
54
55
56
57
58
59
+ [],
60
61
0 commit comments