Skip to content

Commit 9c3d989

Browse files
committed
2.0.4
1 parent 0db0ebb commit 9c3d989

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

dist/fast-json-patch.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! fast-json-patch, version: 2.0.2 */
1+
/*! fast-json-patch, version: 2.0.4 */
22
var jsonpatch =
33
/******/ (function(modules) { // webpackBootstrap
44
/******/ // The module cache
@@ -485,6 +485,11 @@ exports.applyOperation = applyOperation;
485485
* @return An array of `{newDocument, result}` after the patch
486486
*/
487487
function applyPatch(document, patch, validateOperation) {
488+
if (validateOperation) {
489+
if (!Array.isArray(patch)) {
490+
throw new exports.JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');
491+
}
492+
}
488493
var results = new Array(patch.length);
489494
for (var i = 0, length_1 = patch.length; i < length_1; i++) {
490495
results[i] = applyOperation(document, patch[i], validateOperation);

0 commit comments

Comments
 (0)