Skip to content

Commit

Permalink
2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero committed Jul 21, 2017
1 parent 0db0ebb commit 9c3d989
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion dist/fast-json-patch.js
@@ -1,4 +1,4 @@
/*! fast-json-patch, version: 2.0.2 */
/*! fast-json-patch, version: 2.0.4 */
var jsonpatch =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
Expand Down Expand Up @@ -485,6 +485,11 @@ exports.applyOperation = applyOperation;
* @return An array of `{newDocument, result}` after the patch
*/
function applyPatch(document, patch, validateOperation) {
if (validateOperation) {
if (!Array.isArray(patch)) {
throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');
}
}
var results = new Array(patch.length);
for (var i = 0, length_1 = patch.length; i < length_1; i++) {
results[i] = applyOperation(document, patch[i], validateOperation);
Expand Down

0 comments on commit 9c3d989

Please sign in to comment.