cdk8s 2.3.11 → 2.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/changelog.md +6 -1
- package/lib/api-object.js +1 -1
- package/lib/app.js +1 -1
- package/lib/chart.js +1 -1
- package/lib/dependency.js +2 -2
- package/lib/duration.js +1 -1
- package/lib/helm.js +1 -1
- package/lib/include.js +1 -1
- package/lib/json-patch.js +4 -4
- package/lib/lazy.js +1 -1
- package/lib/metadata.js +1 -1
- package/lib/names.js +1 -1
- package/lib/size.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/yaml.js +1 -1
- package/node_modules/fast-json-patch/LICENSE.txt +1 -1
- package/node_modules/fast-json-patch/README.md +183 -164
- package/node_modules/fast-json-patch/{lib → commonjs}/core.d.ts +4 -23
- package/node_modules/fast-json-patch/{lib → commonjs}/core.js +78 -33
- package/node_modules/fast-json-patch/commonjs/duplex.d.ts +23 -0
- package/node_modules/fast-json-patch/{lib → commonjs}/duplex.js +16 -56
- package/node_modules/fast-json-patch/{lib → commonjs}/helpers.d.ts +2 -2
- package/node_modules/fast-json-patch/{lib → commonjs}/helpers.js +9 -9
- package/node_modules/fast-json-patch/dist/fast-json-patch.js +121 -161
- package/node_modules/fast-json-patch/dist/fast-json-patch.min.js +6 -6
- package/node_modules/fast-json-patch/index.d.ts +34 -0
- package/node_modules/fast-json-patch/index.js +11 -0
- package/node_modules/fast-json-patch/index.mjs +29 -0
- package/node_modules/fast-json-patch/index.ts +31 -0
- package/node_modules/fast-json-patch/jasmine-run.mjs +23 -0
- package/node_modules/fast-json-patch/module/core.d.ts +111 -0
- package/node_modules/fast-json-patch/module/core.mjs +433 -0
- package/node_modules/fast-json-patch/module/duplex.d.ts +23 -0
- package/node_modules/fast-json-patch/module/duplex.mjs +176 -0
- package/node_modules/fast-json-patch/module/helpers.d.ts +41 -0
- package/node_modules/fast-json-patch/module/helpers.mjs +171 -0
- package/node_modules/fast-json-patch/package.json +63 -67
- package/node_modules/fast-json-patch/tsc-to-mjs.sh +10 -0
- package/node_modules/fast-json-patch/webpack.config.js +2 -3
- package/package.json +2 -2
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
- package/node_modules/fast-json-patch/lib/duplex.d.ts +0 -63
- package/node_modules/fast-json-patch/node_modules/fast-deep-equal/LICENSE +0 -21
- package/node_modules/fast-json-patch/node_modules/fast-deep-equal/README.md +0 -58
- package/node_modules/fast-json-patch/node_modules/fast-deep-equal/index.d.ts +0 -4
- package/node_modules/fast-json-patch/node_modules/fast-deep-equal/index.js +0 -55
- package/node_modules/fast-json-patch/node_modules/fast-deep-equal/package.json +0 -59
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fast-json-patch, version:
|
|
1
|
+
/*! fast-json-patch, version: 3.1.1 */
|
|
2
2
|
var jsonpatch =
|
|
3
3
|
/******/ (function(modules) { // webpackBootstrap
|
|
4
4
|
/******/ // The module cache
|
|
@@ -92,8 +92,8 @@ var jsonpatch =
|
|
|
92
92
|
|
|
93
93
|
/*!
|
|
94
94
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
95
|
-
* (c) 2017 Joachim Wester
|
|
96
|
-
* MIT
|
|
95
|
+
* (c) 2017-2022 Joachim Wester
|
|
96
|
+
* MIT licensed
|
|
97
97
|
*/
|
|
98
98
|
var __extends = (this && this.__extends) || (function () {
|
|
99
99
|
var extendStatics = function (d, b) {
|
|
@@ -116,11 +116,11 @@ function hasOwnProperty(obj, key) {
|
|
|
116
116
|
exports.hasOwnProperty = hasOwnProperty;
|
|
117
117
|
function _objectKeys(obj) {
|
|
118
118
|
if (Array.isArray(obj)) {
|
|
119
|
-
var
|
|
120
|
-
for (var k = 0; k <
|
|
121
|
-
|
|
119
|
+
var keys_1 = new Array(obj.length);
|
|
120
|
+
for (var k = 0; k < keys_1.length; k++) {
|
|
121
|
+
keys_1[k] = "" + k;
|
|
122
122
|
}
|
|
123
|
-
return
|
|
123
|
+
return keys_1;
|
|
124
124
|
}
|
|
125
125
|
if (Object.keys) {
|
|
126
126
|
return Object.keys(obj);
|
|
@@ -214,7 +214,7 @@ function getPath(root, obj) {
|
|
|
214
214
|
if (path === '') {
|
|
215
215
|
throw new Error("Object not found in root");
|
|
216
216
|
}
|
|
217
|
-
return
|
|
217
|
+
return "/" + path;
|
|
218
218
|
}
|
|
219
219
|
exports.getPath = getPath;
|
|
220
220
|
/**
|
|
@@ -226,8 +226,8 @@ function hasUndefined(obj) {
|
|
|
226
226
|
}
|
|
227
227
|
if (obj) {
|
|
228
228
|
if (Array.isArray(obj)) {
|
|
229
|
-
for (var
|
|
230
|
-
if (hasUndefined(obj[
|
|
229
|
+
for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {
|
|
230
|
+
if (hasUndefined(obj[i_1])) {
|
|
231
231
|
return true;
|
|
232
232
|
}
|
|
233
233
|
}
|
|
@@ -278,10 +278,9 @@ exports.PatchError = PatchError;
|
|
|
278
278
|
/***/ (function(module, exports, __webpack_require__) {
|
|
279
279
|
|
|
280
280
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
281
|
-
var
|
|
282
|
-
|
|
283
|
-
exports.
|
|
284
|
-
exports.deepClone = helpers_1._deepClone;
|
|
281
|
+
var helpers_js_1 = __webpack_require__(0);
|
|
282
|
+
exports.JsonPatchError = helpers_js_1.PatchError;
|
|
283
|
+
exports.deepClone = helpers_js_1._deepClone;
|
|
285
284
|
/* We use a Javascript hash to store each
|
|
286
285
|
function. Each hash entry (property) uses
|
|
287
286
|
the operation identifiers specified in rfc6902.
|
|
@@ -310,7 +309,7 @@ var objOps = {
|
|
|
310
309
|
and is potentially unneeded */
|
|
311
310
|
var removed = getValueByPointer(document, this.path);
|
|
312
311
|
if (removed) {
|
|
313
|
-
removed =
|
|
312
|
+
removed = helpers_js_1._deepClone(removed);
|
|
314
313
|
}
|
|
315
314
|
var originalValue = applyOperation(document, { op: "remove", path: this.from }).removed;
|
|
316
315
|
applyOperation(document, { op: "add", path: this.path, value: originalValue });
|
|
@@ -319,11 +318,11 @@ var objOps = {
|
|
|
319
318
|
copy: function (obj, key, document) {
|
|
320
319
|
var valueToCopy = getValueByPointer(document, this.from);
|
|
321
320
|
// enforce copy by value so further operations don't affect source (see issue #177)
|
|
322
|
-
applyOperation(document, { op: "add", path: this.path, value:
|
|
321
|
+
applyOperation(document, { op: "add", path: this.path, value: helpers_js_1._deepClone(valueToCopy) });
|
|
323
322
|
return { newDocument: document };
|
|
324
323
|
},
|
|
325
324
|
test: function (obj, key, document) {
|
|
326
|
-
return { newDocument: document, test:
|
|
325
|
+
return { newDocument: document, test: _areEquals(obj[key], this.value) };
|
|
327
326
|
},
|
|
328
327
|
_get: function (obj, key, document) {
|
|
329
328
|
this.value = obj[key];
|
|
@@ -333,7 +332,7 @@ var objOps = {
|
|
|
333
332
|
/* The operations applicable to an array. Many are the same as for the object */
|
|
334
333
|
var arrOps = {
|
|
335
334
|
add: function (arr, i, document) {
|
|
336
|
-
if (
|
|
335
|
+
if (helpers_js_1.isInteger(i)) {
|
|
337
336
|
arr.splice(i, 0, this.value);
|
|
338
337
|
}
|
|
339
338
|
else { // array props
|
|
@@ -420,7 +419,7 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
|
|
|
420
419
|
return returnValue;
|
|
421
420
|
}
|
|
422
421
|
else if (operation.op === 'test') {
|
|
423
|
-
returnValue.test =
|
|
422
|
+
returnValue.test = _areEquals(document, operation.value);
|
|
424
423
|
if (returnValue.test === false) {
|
|
425
424
|
throw new exports.JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
|
|
426
425
|
}
|
|
@@ -447,7 +446,7 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
|
|
|
447
446
|
} /* END ROOT OPERATIONS */
|
|
448
447
|
else {
|
|
449
448
|
if (!mutateDocument) {
|
|
450
|
-
document =
|
|
449
|
+
document = helpers_js_1._deepClone(document);
|
|
451
450
|
}
|
|
452
451
|
var path = operation.path || "";
|
|
453
452
|
var keys = path.split('/');
|
|
@@ -465,8 +464,13 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
|
|
|
465
464
|
}
|
|
466
465
|
while (true) {
|
|
467
466
|
key = keys[t];
|
|
468
|
-
if (
|
|
469
|
-
|
|
467
|
+
if (key && key.indexOf('~') != -1) {
|
|
468
|
+
key = helpers_js_1.unescapePathComponent(key);
|
|
469
|
+
}
|
|
470
|
+
if (banPrototypeModifications &&
|
|
471
|
+
(key == '__proto__' ||
|
|
472
|
+
(key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {
|
|
473
|
+
throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');
|
|
470
474
|
}
|
|
471
475
|
if (validateOperation) {
|
|
472
476
|
if (existingPathFragment === undefined) {
|
|
@@ -487,10 +491,10 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
|
|
|
487
491
|
key = obj.length;
|
|
488
492
|
}
|
|
489
493
|
else {
|
|
490
|
-
if (validateOperation && !
|
|
494
|
+
if (validateOperation && !helpers_js_1.isInteger(key)) {
|
|
491
495
|
throw new exports.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", index, operation, document);
|
|
492
496
|
} // only parse key when it's an integer for `arr.prop` to work
|
|
493
|
-
else if (
|
|
497
|
+
else if (helpers_js_1.isInteger(key)) {
|
|
494
498
|
key = ~~key;
|
|
495
499
|
}
|
|
496
500
|
}
|
|
@@ -506,9 +510,6 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
|
|
|
506
510
|
}
|
|
507
511
|
}
|
|
508
512
|
else {
|
|
509
|
-
if (key && key.indexOf('~') != -1) {
|
|
510
|
-
key = helpers_1.unescapePathComponent(key);
|
|
511
|
-
}
|
|
512
513
|
if (t >= len) {
|
|
513
514
|
var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch
|
|
514
515
|
if (returnValue.test === false) {
|
|
@@ -518,6 +519,11 @@ function applyOperation(document, operation, validateOperation, mutateDocument,
|
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
521
|
obj = obj[key];
|
|
522
|
+
// If we have more keys in the path, but the next value isn't a non-null object,
|
|
523
|
+
// throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.
|
|
524
|
+
if (validateOperation && t < len && (!obj || typeof obj !== "object")) {
|
|
525
|
+
throw new exports.JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);
|
|
526
|
+
}
|
|
521
527
|
}
|
|
522
528
|
}
|
|
523
529
|
}
|
|
@@ -545,7 +551,7 @@ function applyPatch(document, patch, validateOperation, mutateDocument, banProto
|
|
|
545
551
|
}
|
|
546
552
|
}
|
|
547
553
|
if (!mutateDocument) {
|
|
548
|
-
document =
|
|
554
|
+
document = helpers_js_1._deepClone(document);
|
|
549
555
|
}
|
|
550
556
|
var results = new Array(patch.length);
|
|
551
557
|
for (var i = 0, length_1 = patch.length; i < length_1; i++) {
|
|
@@ -601,7 +607,7 @@ function validator(operation, index, document, existingPathFragment) {
|
|
|
601
607
|
else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {
|
|
602
608
|
throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);
|
|
603
609
|
}
|
|
604
|
-
else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') &&
|
|
610
|
+
else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && helpers_js_1.hasUndefined(operation.value)) {
|
|
605
611
|
throw new exports.JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);
|
|
606
612
|
}
|
|
607
613
|
else if (document) {
|
|
@@ -641,7 +647,7 @@ function validate(sequence, document, externalValidator) {
|
|
|
641
647
|
}
|
|
642
648
|
if (document) {
|
|
643
649
|
//clone document and sequence so that we can safely try applying operations
|
|
644
|
-
applyPatch(
|
|
650
|
+
applyPatch(helpers_js_1._deepClone(document), helpers_js_1._deepClone(sequence), externalValidator || true);
|
|
645
651
|
}
|
|
646
652
|
else {
|
|
647
653
|
externalValidator = externalValidator || validator;
|
|
@@ -660,58 +666,89 @@ function validate(sequence, document, externalValidator) {
|
|
|
660
666
|
}
|
|
661
667
|
}
|
|
662
668
|
exports.validate = validate;
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
669
|
+
// based on https://github.com/epoberezkin/fast-deep-equal
|
|
670
|
+
// MIT License
|
|
671
|
+
// Copyright (c) 2017 Evgeny Poberezkin
|
|
672
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
673
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
674
|
+
// in the Software without restriction, including without limitation the rights
|
|
675
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
676
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
677
|
+
// furnished to do so, subject to the following conditions:
|
|
678
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
679
|
+
// copies or substantial portions of the Software.
|
|
680
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
681
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
682
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
683
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
684
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
685
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
686
|
+
// SOFTWARE.
|
|
687
|
+
function _areEquals(a, b) {
|
|
688
|
+
if (a === b)
|
|
689
|
+
return true;
|
|
690
|
+
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
691
|
+
var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;
|
|
692
|
+
if (arrA && arrB) {
|
|
693
|
+
length = a.length;
|
|
694
|
+
if (length != b.length)
|
|
695
|
+
return false;
|
|
696
|
+
for (i = length; i-- !== 0;)
|
|
697
|
+
if (!_areEquals(a[i], b[i]))
|
|
698
|
+
return false;
|
|
699
|
+
return true;
|
|
700
|
+
}
|
|
701
|
+
if (arrA != arrB)
|
|
702
|
+
return false;
|
|
703
|
+
var keys = Object.keys(a);
|
|
704
|
+
length = keys.length;
|
|
705
|
+
if (length !== Object.keys(b).length)
|
|
706
|
+
return false;
|
|
707
|
+
for (i = length; i-- !== 0;)
|
|
708
|
+
if (!b.hasOwnProperty(keys[i]))
|
|
709
|
+
return false;
|
|
710
|
+
for (i = length; i-- !== 0;) {
|
|
711
|
+
key = keys[i];
|
|
712
|
+
if (!_areEquals(a[key], b[key]))
|
|
713
|
+
return false;
|
|
714
|
+
}
|
|
715
|
+
return true;
|
|
716
|
+
}
|
|
717
|
+
return a !== a && b !== b;
|
|
718
|
+
}
|
|
719
|
+
exports._areEquals = _areEquals;
|
|
720
|
+
;
|
|
676
721
|
|
|
677
722
|
|
|
678
723
|
/***/ }),
|
|
679
724
|
/* 2 */
|
|
680
725
|
/***/ (function(module, exports, __webpack_require__) {
|
|
681
726
|
|
|
682
|
-
var
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
727
|
+
var core = __webpack_require__(1);
|
|
728
|
+
Object.assign(exports, core);
|
|
729
|
+
|
|
730
|
+
var duplex = __webpack_require__(3);
|
|
731
|
+
Object.assign(exports, duplex);
|
|
732
|
+
|
|
733
|
+
var helpers = __webpack_require__(0);
|
|
734
|
+
exports.JsonPatchError = helpers.PatchError;
|
|
735
|
+
exports.deepClone = helpers._deepClone;
|
|
736
|
+
exports.escapePathComponent = helpers.escapePathComponent;
|
|
737
|
+
exports.unescapePathComponent = helpers.unescapePathComponent;
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
/***/ }),
|
|
741
|
+
/* 3 */
|
|
742
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
743
|
+
|
|
693
744
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
694
745
|
/*!
|
|
695
746
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
696
|
-
* (c) 2017 Joachim Wester
|
|
747
|
+
* (c) 2017-2021 Joachim Wester
|
|
697
748
|
* MIT license
|
|
698
749
|
*/
|
|
699
|
-
var
|
|
700
|
-
var
|
|
701
|
-
/* export all core functions and types */
|
|
702
|
-
var core_2 = __webpack_require__(1);
|
|
703
|
-
exports.applyOperation = core_2.applyOperation;
|
|
704
|
-
exports.applyPatch = core_2.applyPatch;
|
|
705
|
-
exports.applyReducer = core_2.applyReducer;
|
|
706
|
-
exports.getValueByPointer = core_2.getValueByPointer;
|
|
707
|
-
exports.validate = core_2.validate;
|
|
708
|
-
exports.validator = core_2.validator;
|
|
709
|
-
/* export some helpers */
|
|
710
|
-
var helpers_2 = __webpack_require__(0);
|
|
711
|
-
exports.JsonPatchError = helpers_2.PatchError;
|
|
712
|
-
exports.deepClone = helpers_2._deepClone;
|
|
713
|
-
exports.escapePathComponent = helpers_2.escapePathComponent;
|
|
714
|
-
exports.unescapePathComponent = helpers_2.unescapePathComponent;
|
|
750
|
+
var helpers_js_1 = __webpack_require__(0);
|
|
751
|
+
var core_js_1 = __webpack_require__(1);
|
|
715
752
|
var beforeDict = new WeakMap();
|
|
716
753
|
var Mirror = /** @class */ (function () {
|
|
717
754
|
function Mirror(obj) {
|
|
@@ -762,7 +799,7 @@ function observe(obj, callback) {
|
|
|
762
799
|
return observer;
|
|
763
800
|
}
|
|
764
801
|
observer = {};
|
|
765
|
-
mirror.value =
|
|
802
|
+
mirror.value = helpers_js_1._deepClone(obj);
|
|
766
803
|
if (callback) {
|
|
767
804
|
observer.callback = callback;
|
|
768
805
|
observer.next = null;
|
|
@@ -807,7 +844,7 @@ function generate(observer, invertible) {
|
|
|
807
844
|
var mirror = beforeDict.get(observer.object);
|
|
808
845
|
_generate(mirror.value, observer.object, observer.patches, "", invertible);
|
|
809
846
|
if (observer.patches.length) {
|
|
810
|
-
|
|
847
|
+
core_js_1.applyPatch(mirror.value, observer.patches);
|
|
811
848
|
}
|
|
812
849
|
var temp = observer.patches;
|
|
813
850
|
if (temp.length > 0) {
|
|
@@ -827,34 +864,34 @@ function _generate(mirror, obj, patches, path, invertible) {
|
|
|
827
864
|
if (typeof obj.toJSON === "function") {
|
|
828
865
|
obj = obj.toJSON();
|
|
829
866
|
}
|
|
830
|
-
var newKeys =
|
|
831
|
-
var oldKeys =
|
|
867
|
+
var newKeys = helpers_js_1._objectKeys(obj);
|
|
868
|
+
var oldKeys = helpers_js_1._objectKeys(mirror);
|
|
832
869
|
var changed = false;
|
|
833
870
|
var deleted = false;
|
|
834
871
|
//if ever "move" operation is implemented here, make sure this test runs OK: "should not generate the same patch twice (move)"
|
|
835
872
|
for (var t = oldKeys.length - 1; t >= 0; t--) {
|
|
836
873
|
var key = oldKeys[t];
|
|
837
874
|
var oldVal = mirror[key];
|
|
838
|
-
if (
|
|
875
|
+
if (helpers_js_1.hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {
|
|
839
876
|
var newVal = obj[key];
|
|
840
|
-
if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null) {
|
|
841
|
-
_generate(oldVal, newVal, patches, path + "/" +
|
|
877
|
+
if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {
|
|
878
|
+
_generate(oldVal, newVal, patches, path + "/" + helpers_js_1.escapePathComponent(key), invertible);
|
|
842
879
|
}
|
|
843
880
|
else {
|
|
844
881
|
if (oldVal !== newVal) {
|
|
845
882
|
changed = true;
|
|
846
883
|
if (invertible) {
|
|
847
|
-
patches.push({ op: "test", path: path + "/" +
|
|
884
|
+
patches.push({ op: "test", path: path + "/" + helpers_js_1.escapePathComponent(key), value: helpers_js_1._deepClone(oldVal) });
|
|
848
885
|
}
|
|
849
|
-
patches.push({ op: "replace", path: path + "/" +
|
|
886
|
+
patches.push({ op: "replace", path: path + "/" + helpers_js_1.escapePathComponent(key), value: helpers_js_1._deepClone(newVal) });
|
|
850
887
|
}
|
|
851
888
|
}
|
|
852
889
|
}
|
|
853
890
|
else if (Array.isArray(mirror) === Array.isArray(obj)) {
|
|
854
891
|
if (invertible) {
|
|
855
|
-
patches.push({ op: "test", path: path + "/" +
|
|
892
|
+
patches.push({ op: "test", path: path + "/" + helpers_js_1.escapePathComponent(key), value: helpers_js_1._deepClone(oldVal) });
|
|
856
893
|
}
|
|
857
|
-
patches.push({ op: "remove", path: path + "/" +
|
|
894
|
+
patches.push({ op: "remove", path: path + "/" + helpers_js_1.escapePathComponent(key) });
|
|
858
895
|
deleted = true; // property has been deleted
|
|
859
896
|
}
|
|
860
897
|
else {
|
|
@@ -870,8 +907,8 @@ function _generate(mirror, obj, patches, path, invertible) {
|
|
|
870
907
|
}
|
|
871
908
|
for (var t = 0; t < newKeys.length; t++) {
|
|
872
909
|
var key = newKeys[t];
|
|
873
|
-
if (!
|
|
874
|
-
patches.push({ op: "add", path: path + "/" +
|
|
910
|
+
if (!helpers_js_1.hasOwnProperty(mirror, key) && obj[key] !== undefined) {
|
|
911
|
+
patches.push({ op: "add", path: path + "/" + helpers_js_1.escapePathComponent(key), value: helpers_js_1._deepClone(obj[key]) });
|
|
875
912
|
}
|
|
876
913
|
}
|
|
877
914
|
}
|
|
@@ -885,83 +922,6 @@ function compare(tree1, tree2, invertible) {
|
|
|
885
922
|
return patches;
|
|
886
923
|
}
|
|
887
924
|
exports.compare = compare;
|
|
888
|
-
/**
|
|
889
|
-
* Default export for backwards compat
|
|
890
|
-
*/
|
|
891
|
-
// import just to re-export as default
|
|
892
|
-
var core = __webpack_require__(1);
|
|
893
|
-
var helpers_3 = __webpack_require__(0);
|
|
894
|
-
exports.default = __assign({}, core, {
|
|
895
|
-
// duplex
|
|
896
|
-
unobserve: unobserve,
|
|
897
|
-
observe: observe,
|
|
898
|
-
generate: generate,
|
|
899
|
-
compare: compare,
|
|
900
|
-
// helpers
|
|
901
|
-
JsonPatchError: helpers_3.PatchError, deepClone: helpers_1._deepClone, escapePathComponent: helpers_1.escapePathComponent,
|
|
902
|
-
unescapePathComponent: helpers_3.unescapePathComponent });
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
/***/ }),
|
|
906
|
-
/* 3 */
|
|
907
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
908
|
-
|
|
909
|
-
"use strict";
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
var isArray = Array.isArray;
|
|
913
|
-
var keyList = Object.keys;
|
|
914
|
-
var hasProp = Object.prototype.hasOwnProperty;
|
|
915
|
-
|
|
916
|
-
module.exports = function equal(a, b) {
|
|
917
|
-
if (a === b) return true;
|
|
918
|
-
|
|
919
|
-
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
920
|
-
var arrA = isArray(a)
|
|
921
|
-
, arrB = isArray(b)
|
|
922
|
-
, i
|
|
923
|
-
, length
|
|
924
|
-
, key;
|
|
925
|
-
|
|
926
|
-
if (arrA && arrB) {
|
|
927
|
-
length = a.length;
|
|
928
|
-
if (length != b.length) return false;
|
|
929
|
-
for (i = length; i-- !== 0;)
|
|
930
|
-
if (!equal(a[i], b[i])) return false;
|
|
931
|
-
return true;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
if (arrA != arrB) return false;
|
|
935
|
-
|
|
936
|
-
var dateA = a instanceof Date
|
|
937
|
-
, dateB = b instanceof Date;
|
|
938
|
-
if (dateA != dateB) return false;
|
|
939
|
-
if (dateA && dateB) return a.getTime() == b.getTime();
|
|
940
|
-
|
|
941
|
-
var regexpA = a instanceof RegExp
|
|
942
|
-
, regexpB = b instanceof RegExp;
|
|
943
|
-
if (regexpA != regexpB) return false;
|
|
944
|
-
if (regexpA && regexpB) return a.toString() == b.toString();
|
|
945
|
-
|
|
946
|
-
var keys = keyList(a);
|
|
947
|
-
length = keys.length;
|
|
948
|
-
|
|
949
|
-
if (length !== keyList(b).length)
|
|
950
|
-
return false;
|
|
951
|
-
|
|
952
|
-
for (i = length; i-- !== 0;)
|
|
953
|
-
if (!hasProp.call(b, keys[i])) return false;
|
|
954
|
-
|
|
955
|
-
for (i = length; i-- !== 0;) {
|
|
956
|
-
key = keys[i];
|
|
957
|
-
if (!equal(a[key], b[key])) return false;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
return true;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
return a!==a && b!==b;
|
|
964
|
-
};
|
|
965
925
|
|
|
966
926
|
|
|
967
927
|
/***/ })
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/*! fast-json-patch, version:
|
|
1
|
+
/*! fast-json-patch, version: 3.1.1 */
|
|
2
2
|
var jsonpatch=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t){
|
|
3
3
|
/*!
|
|
4
4
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
5
|
-
* (c) 2017 Joachim Wester
|
|
6
|
-
* MIT
|
|
5
|
+
* (c) 2017-2022 Joachim Wester
|
|
6
|
+
* MIT licensed
|
|
7
7
|
*/
|
|
8
|
-
var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=Object.prototype.hasOwnProperty;function a(e,t){return o.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);
|
|
8
|
+
var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=Object.prototype.hasOwnProperty;function a(e,t){return o.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)a(e,o)&&n.push(o);return n}function p(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function u(e,t){var r;for(var n in e)if(a(e,n)){if(e[n]===t)return p(n)+"/";if("object"==typeof e[n]&&""!=(r=u(e[n],t)))return p(n)+"/"+r}return""}function s(e,t){var r=[e];for(var n in t){var o="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==o&&r.push(n+": "+o)}return r.join("\n")}t.hasOwnProperty=a,t._objectKeys=i,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0},t.escapePathComponent=p,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=u,t.getPath=function(e,t){if(e===t)return"/";var r=u(e,t);if(""===r)throw new Error("Object not found in root");return"/"+r},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return!0}else if("object"==typeof t)for(var o=i(t),a=o.length,p=0;p<a;p++)if(e(t[o[p]]))return!0;return!1};var c=function(e){function t(t,r,n,o,a){var i=this.constructor,p=e.call(this,s(t,{name:r,index:n,operation:o,tree:a}))||this;return p.name=r,p.index=n,p.operation=o,p.tree=a,Object.setPrototypeOf(p,i.prototype),p.message=s(t,{name:r,index:n,operation:o,tree:a}),p}return n(t,e),t}(Error);t.PatchError=c},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);t.JsonPatchError=n.PatchError,t.deepClone=n._deepClone;var o={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var o=i(r,this.path);o&&(o=n._deepClone(o));var a=p(r,{op:"remove",path:this.from}).removed;return p(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:o}},copy:function(e,t,r){var o=i(r,this.from);return p(r,{op:"add",path:this.path,value:n._deepClone(o)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:f(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},a={add:function(e,t,r){return n.isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:o.move,copy:o.copy,test:o.test,_get:o._get};function i(e,t){if(""==t)return e;var r={op:"_get",path:t};return p(e,r),r.value}function p(e,r,p,u,c,h){if(void 0===p&&(p=!1),void 0===u&&(u=!0),void 0===c&&(c=!0),void 0===h&&(h=0),p&&("function"==typeof p?p(r,0,e,r.path):s(r,0)),""===r.path){var l={newDocument:e};if("add"===r.op)return l.newDocument=r.value,l;if("replace"===r.op)return l.newDocument=r.value,l.removed=e,l;if("move"===r.op||"copy"===r.op)return l.newDocument=i(e,r.from),"move"===r.op&&(l.removed=e),l;if("test"===r.op){if(l.test=f(e,r.value),!1===l.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",h,r,e);return l.newDocument=e,l}if("remove"===r.op)return l.removed=e,l.newDocument=null,l;if("_get"===r.op)return r.value=e,l;if(p)throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",h,r,e);return l}u||(e=n._deepClone(e));var d=(r.path||"").split("/"),v=e,y=1,w=d.length,_=void 0,O=void 0,m=void 0;for(m="function"==typeof p?p:s;;){if((O=d[y])&&-1!=O.indexOf("~")&&(O=n.unescapePathComponent(O)),c&&("__proto__"==O||"prototype"==O&&y>0&&"constructor"==d[y-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(p&&void 0===_&&(void 0===v[O]?_=d.slice(0,y).join("/"):y==w-1&&(_=r.path),void 0!==_&&m(r,0,e,_)),y++,Array.isArray(v)){if("-"===O)O=v.length;else{if(p&&!n.isInteger(O))throw new t.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",h,r,e);n.isInteger(O)&&(O=~~O)}if(y>=w){if(p&&"add"===r.op&&O>v.length)throw new t.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",h,r,e);if(!1===(l=a[r.op].call(r,v,O,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",h,r,e);return l}}else if(y>=w){if(!1===(l=o[r.op].call(r,v,O,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",h,r,e);return l}if(v=v[O],p&&y<w&&(!v||"object"!=typeof v))throw new t.JsonPatchError("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",h,r,e)}}function u(e,r,o,a,i){if(void 0===a&&(a=!0),void 0===i&&(i=!0),o&&!Array.isArray(r))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");a||(e=n._deepClone(e));for(var u=new Array(r.length),s=0,c=r.length;s<c;s++)u[s]=p(e,r[s],o,!0,i,s),e=u[s].newDocument;return u.newDocument=e,u}function s(e,r,a,i){if("object"!=typeof e||null===e||Array.isArray(e))throw new t.JsonPatchError("Operation is not an object","OPERATION_NOT_AN_OBJECT",r,e,a);if(!o[e.op])throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",r,e,a);if("string"!=typeof e.path)throw new t.JsonPatchError("Operation `path` property is not a string","OPERATION_PATH_INVALID",r,e,a);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new t.JsonPatchError('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",r,e,a);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new t.JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",r,e,a);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",r,e,a);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&n.hasUndefined(e.value))throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",r,e,a);if(a)if("add"==e.op){var p=e.path.split("/").length,u=i.split("/").length;if(p!==u+1&&p!==u)throw new t.JsonPatchError("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",r,e,a)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==i)throw new t.JsonPatchError("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",r,e,a)}else if("move"===e.op||"copy"===e.op){var s=c([{op:"_get",path:e.from,value:void 0}],a);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new t.JsonPatchError("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",r,e,a)}}function c(e,r,o){try{if(!Array.isArray(e))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(r)u(n._deepClone(r),n._deepClone(e),o||!0);else{o=o||s;for(var a=0;a<e.length;a++)o(e[a],a,r,void 0)}}catch(e){if(e instanceof t.JsonPatchError)return e;throw e}}function f(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,o,a=Array.isArray(e),i=Array.isArray(t);if(a&&i){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!f(e[r],t[r]))return!1;return!0}if(a!=i)return!1;var p=Object.keys(e);if((n=p.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(p[r]))return!1;for(r=n;0!=r--;)if(!f(e[o=p[r]],t[o]))return!1;return!0}return e!=e&&t!=t}t.getValueByPointer=i,t.applyOperation=p,t.applyPatch=u,t.applyReducer=function(e,r,n){var o=p(e,r);if(!1===o.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",n,r,e);return o.newDocument},t.validator=s,t.validate=c,t._areEquals=f},function(e,t,r){var n=r(1);Object.assign(t,n);var o=r(3);Object.assign(t,o);var a=r(0);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone,t.escapePathComponent=a.escapePathComponent,t.unescapePathComponent=a.unescapePathComponent},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});
|
|
9
9
|
/*!
|
|
10
10
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
11
|
-
* (c) 2017 Joachim Wester
|
|
11
|
+
* (c) 2017-2021 Joachim Wester
|
|
12
12
|
* MIT license
|
|
13
13
|
*/
|
|
14
|
-
var
|
|
14
|
+
var n=r(0),o=r(1),a=new WeakMap,i=function(e){this.observers=new Map,this.obj=e},p=function(e,t){this.callback=e,this.observer=t};function u(e,t){void 0===t&&(t=!1);var r=a.get(e.object);s(r.value,e.object,e.patches,"",t),e.patches.length&&o.applyPatch(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function s(e,t,r,o,a){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var i=n._objectKeys(t),p=n._objectKeys(e),u=!1,c=p.length-1;c>=0;c--){var f=e[l=p[c]];if(!n.hasOwnProperty(t,l)||void 0===t[l]&&void 0!==f&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:o+"/"+n.escapePathComponent(l),value:n._deepClone(f)}),r.push({op:"remove",path:o+"/"+n.escapePathComponent(l)}),u=!0):(a&&r.push({op:"test",path:o,value:e}),r.push({op:"replace",path:o,value:t}),!0);else{var h=t[l];"object"==typeof f&&null!=f&&"object"==typeof h&&null!=h&&Array.isArray(f)===Array.isArray(h)?s(f,h,r,o+"/"+n.escapePathComponent(l),a):f!==h&&(!0,a&&r.push({op:"test",path:o+"/"+n.escapePathComponent(l),value:n._deepClone(f)}),r.push({op:"replace",path:o+"/"+n.escapePathComponent(l),value:n._deepClone(h)}))}}if(u||i.length!=p.length)for(c=0;c<i.length;c++){var l=i[c];n.hasOwnProperty(e,l)||void 0===t[l]||r.push({op:"add",path:o+"/"+n.escapePathComponent(l),value:n._deepClone(t[l])})}}}t.unobserve=function(e,t){t.unobserve()},t.observe=function(e,t){var r,o=function(e){return a.get(e)}(e);if(o){var s=function(e,t){return e.observers.get(t)}(o,t);r=s&&s.observer}else o=new i(e),a.set(e,o);if(r)return r;if(r={},o.value=n._deepClone(e),t){r.callback=t,r.next=null;var c=function(){u(r)},f=function(){clearTimeout(r.next),r.next=setTimeout(c)};"undefined"!=typeof window&&(window.addEventListener("mouseup",f),window.addEventListener("keyup",f),window.addEventListener("mousedown",f),window.addEventListener("keydown",f),window.addEventListener("change",f))}return r.patches=[],r.object=e,r.unobserve=function(){u(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(o,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",f),window.removeEventListener("keyup",f),window.removeEventListener("mousedown",f),window.removeEventListener("keydown",f),window.removeEventListener("change",f))},o.observers.set(t,new p(t,r)),r},t.generate=u,t.compare=function(e,t,r){void 0===r&&(r=!1);var n=[];return s(e,t,n,"",r),n}}]);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export * from './module/core';
|
|
2
|
+
export * from './module/duplex';
|
|
3
|
+
export {
|
|
4
|
+
PatchError as JsonPatchError,
|
|
5
|
+
_deepClone as deepClone,
|
|
6
|
+
escapePathComponent,
|
|
7
|
+
unescapePathComponent
|
|
8
|
+
} from './module/helpers';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Default export for backwards compat
|
|
13
|
+
*/
|
|
14
|
+
import * as core from './module/core';
|
|
15
|
+
import * as duplex from './module/duplex';
|
|
16
|
+
import { PatchError as JsonPatchError, _deepClone as deepClone, escapePathComponent, unescapePathComponent } from './module/helpers';
|
|
17
|
+
declare const _default: {
|
|
18
|
+
JsonPatchError: typeof JsonPatchError;
|
|
19
|
+
deepClone: typeof deepClone;
|
|
20
|
+
escapePathComponent: typeof escapePathComponent;
|
|
21
|
+
unescapePathComponent: typeof unescapePathComponent;
|
|
22
|
+
unobserve<T>(root: T, observer: duplex.Observer<T>): void;
|
|
23
|
+
observe<T>(obj: Object | T[], callback?: (patches: core.Operation[]) => void): duplex.Observer<T>;
|
|
24
|
+
generate<T>(observer: duplex.Observer<Object>, invertible?: boolean): core.Operation[];
|
|
25
|
+
compare(tree1: Object | any[], tree2: Object | any[], invertible?: boolean): core.Operation[];
|
|
26
|
+
getValueByPointer(document: any, pointer: string): any;
|
|
27
|
+
applyOperation<T>(document: T, operation: core.Operation, validateOperation?: boolean | core.Validator<T>, mutateDocument?: boolean, banPrototypeModifications?: boolean, index?: number): core.OperationResult<T>;
|
|
28
|
+
applyPatch<T>(document: T, patch: core.Operation[], validateOperation?: boolean | core.Validator<T>, mutateDocument?: boolean, banPrototypeModifications?: boolean): core.PatchResult<T>;
|
|
29
|
+
applyReducer<T>(document: T, operation: core.Operation, index: number): T;
|
|
30
|
+
validator(operation: core.Operation, index: number, document?: any, existingPathFragment?: string): void;
|
|
31
|
+
validate<T>(sequence: core.Operation[], document?: T, externalValidator?: core.Validator<T>): JsonPatchError;
|
|
32
|
+
_areEquals(a: any, b: any): boolean;
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var core = require("./commonjs/core.js");
|
|
2
|
+
Object.assign(exports, core);
|
|
3
|
+
|
|
4
|
+
var duplex = require("./commonjs/duplex.js");
|
|
5
|
+
Object.assign(exports, duplex);
|
|
6
|
+
|
|
7
|
+
var helpers = require("./commonjs/helpers.js");
|
|
8
|
+
exports.JsonPatchError = helpers.PatchError;
|
|
9
|
+
exports.deepClone = helpers._deepClone;
|
|
10
|
+
exports.escapePathComponent = helpers.escapePathComponent;
|
|
11
|
+
exports.unescapePathComponent = helpers.unescapePathComponent;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './module/core.mjs';
|
|
2
|
+
export * from './module/duplex.mjs';
|
|
3
|
+
export {
|
|
4
|
+
PatchError as JsonPatchError,
|
|
5
|
+
_deepClone as deepClone,
|
|
6
|
+
escapePathComponent,
|
|
7
|
+
unescapePathComponent
|
|
8
|
+
} from './module/helpers.mjs';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Default export for backwards compat
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import * as core from './module/core.mjs';
|
|
16
|
+
import * as duplex from './module/duplex.mjs';
|
|
17
|
+
import {
|
|
18
|
+
PatchError as JsonPatchError,
|
|
19
|
+
_deepClone as deepClone,
|
|
20
|
+
escapePathComponent,
|
|
21
|
+
unescapePathComponent
|
|
22
|
+
} from './module/helpers.mjs';
|
|
23
|
+
|
|
24
|
+
export default Object.assign({}, core, duplex, {
|
|
25
|
+
JsonPatchError,
|
|
26
|
+
deepClone,
|
|
27
|
+
escapePathComponent,
|
|
28
|
+
unescapePathComponent
|
|
29
|
+
});
|