Skip to content

Commit

Permalink
fix: treat null values
Browse files Browse the repository at this point in the history
  • Loading branch information
rubeniskov committed Dec 1, 2020
1 parent 771b7c5 commit b93da82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"nyc": "^15.1.0"
},
"dependencies": {
"traverse-json": "^0.5.0",
"traverse-json": "^0.5.1",
"is-promise": "^4.0.0",
"jsonpatch": "^3.0.1"
}
Expand Down
6 changes: 6 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ test('should raise error when no operation available', (t) => {
});
});

test('should does nothing when nullish object', (t) => {

const actual = mutateJson(null, () => {});
t.is(actual, null);
});

test('should mutate all entries of the iterator', (t) => {
const expected = {
a: 1,
Expand Down

0 comments on commit b93da82

Please sign in to comment.