Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Applies `patch` array on `obj`.
- `document` The document to patch
- `patch` a JSON-Patch array of operations to apply
- `validateOperation` Boolean for whether to validate each operation with our default validator, or to pass a validator callback
- `mutateDocument` Whether to mutate the original document or clone it before applying
- `mutateDocument` Whether to mutate the original document or clone it before applying, defaults to `true`
- `banPrototypeModifications` Whether to ban modifications to `__proto__`, defaults to `true`.

An invalid patch results in throwing an error (see `jsonpatch.validate` for more information about the error object).
Expand Down Expand Up @@ -133,7 +133,7 @@ Applies single operation object `operation` on `document`.
- `document` The document to patch
- `operation` The operation to apply
- `validateOperation` Whether to validate the operation, or to pass a validator callback
- `mutateDocument` Whether to mutate the original document or clone it before applying
- `mutateDocument` Whether to mutate the original document or clone it before applying, defaults to `true`
- `banPrototypeModifications` Whether to ban modifications to `__proto__`, defaults to `true`.
- `index` The index of the operation in your patch array. Useful for better error reporting when that operation fails to apply.

Expand Down
4 changes: 2 additions & 2 deletions commonjs/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ exports.getValueByPointer = getValueByPointer;
* @param document The document to patch
* @param operation The operation to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return `{newDocument, result}` after the operation
*/
Expand Down Expand Up @@ -259,7 +259,7 @@ exports.applyOperation = applyOperation;
* @param document The document to patch
* @param patch The patch to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return An array of `{newDocument, result}` after the patch
*/
Expand Down
6 changes: 3 additions & 3 deletions dist/fast-json-patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ exports.getValueByPointer = getValueByPointer;
* @param document The document to patch
* @param operation The operation to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return `{newDocument, result}` after the operation
*/
Expand Down Expand Up @@ -538,7 +538,7 @@ exports.applyOperation = applyOperation;
* @param document The document to patch
* @param patch The patch to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return An array of `{newDocument, result}` after the patch
*/
Expand Down Expand Up @@ -925,4 +925,4 @@ exports.compare = compare;


/***/ })
/******/ ]);
/******/ ]);
4 changes: 2 additions & 2 deletions module/core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export declare function getValueByPointer(document: any, pointer: string): any;
* @param document The document to patch
* @param operation The operation to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return `{newDocument, result}` after the operation
*/
Expand All @@ -77,7 +77,7 @@ export declare function applyOperation<T>(document: T, operation: Operation, val
* @param document The document to patch
* @param patch The patch to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return An array of `{newDocument, result}` after the patch
*/
Expand Down
4 changes: 2 additions & 2 deletions module/core.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function getValueByPointer(document, pointer) {
* @param document The document to patch
* @param operation The operation to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return `{newDocument, result}` after the operation
*/
Expand Down Expand Up @@ -256,7 +256,7 @@ export function applyOperation(document, operation, validateOperation, mutateDoc
* @param document The document to patch
* @param patch The patch to apply
* @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
* @param mutateDocument Whether to mutate the original document or clone it before applying
* @param mutateDocument Whether to mutate the original document or clone it before applying, defaults to `true`
* @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
* @return An array of `{newDocument, result}` after the patch
*/
Expand Down
Loading