Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rubeniskov committed Dec 1, 2020
1 parent 91bb3e8 commit 771b7c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Patch definition acording to the [jsonpatch standard](http://jsonpatch.com/)

| Param | Type | Description |
| --- | --- | --- |
| op | <code>&quot;add&quot;</code> \| <code>&quot;remove&quot;</code> \| <code>&quot;replace&quot;</code> \| <code>&quot;move&quot;</code> \| <code>&quot;copy&quot;</code> \| <code>&quot;test&quot;</code> | Patch operation |
| op | <code>&quot;remove&quot;</code> \| <code>&quot;replace&quot;</code> | Patch operation |
| value | <code>any</code> | |
| [path] | <code>String</code> | [JSONPointer](https://tools.ietf.org/html/rfc6901) |
| [from] | <code>String</code> | [JSONPointer](https://tools.ietf.org/html/rfc6901) |
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ const mutantJson = (target, process, opts) => {
return patch.then((res) => applyPatches(res, path, result));
}

if (!patch) return;

const parsedPatch = { op: JSONPATCH_OPS[0], ...patch, path };

if (!JSONPATCH_OPS.includes(parsedPatch.op)) {
Expand Down

0 comments on commit 771b7c5

Please sign in to comment.