@fluid-experimental/property-changeset 0.59.2001 → 0.59.3000
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/dist/changeset.d.ts.map +1 -1
- package/dist/changeset.js +50 -50
- package/dist/changeset.js.map +1 -1
- package/dist/changeset_operations/array.d.ts.map +1 -1
- package/dist/changeset_operations/array.js +22 -22
- package/dist/changeset_operations/array.js.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
- package/dist/changeset_operations/arrayChangesetIterator.js +3 -3
- package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/dist/changeset_operations/indexedCollection.js +21 -21
- package/dist/changeset_operations/indexedCollection.js.map +1 -1
- package/dist/changeset_operations/isEmptyChangeset.js +2 -2
- package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pathHelper.js.map +1 -1
- package/dist/rebase.js +6 -6
- package/dist/rebase.js.map +1 -1
- package/dist/templateSchema.d.ts.map +1 -1
- package/dist/templateSchema.js +1 -0
- package/dist/templateSchema.js.map +1 -1
- package/dist/templateValidator.d.ts.map +1 -1
- package/dist/templateValidator.js +32 -32
- package/dist/templateValidator.js.map +1 -1
- package/dist/test/array.spec.js +40 -40
- package/dist/test/array.spec.js.map +1 -1
- package/dist/test/pathHelper.spec.js +147 -147
- package/dist/test/pathHelper.spec.js.map +1 -1
- package/dist/test/reversibleCs.spec.js +2 -2
- package/dist/test/reversibleCs.spec.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1660
- package/dist/test/validator/templateSyntax.spec.js +29 -29
- package/dist/test/validator/templateSyntax.spec.js.map +1 -1
- package/dist/test/validator/templateValidator.spec.js +202 -202
- package/dist/test/validator/templateValidator.spec.js.map +1 -1
- package/dist/test/validator/typeidHelper.spec.js +39 -39
- package/dist/test/validator/typeidHelper.spec.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +41 -41
- package/dist/utils.js.map +1 -1
- package/lib/changeset.js.map +1 -1
- package/lib/changeset_operations/array.js.map +1 -1
- package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
- package/lib/changeset_operations/indexedCollection.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/pathHelper.js.map +1 -1
- package/lib/rebase.js.map +1 -1
- package/lib/templateSchema.js +1 -0
- package/lib/templateSchema.js.map +1 -1
- package/lib/templateValidator.js +1 -1
- package/lib/templateValidator.js.map +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +4 -4
package/dist/changeset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeset.d.ts","sourceRoot":"","sources":["../src/changeset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAaH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAW/F,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,yBAAyB,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE1C;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"changeset.d.ts","sourceRoot":"","sources":["../src/changeset.ts"],"names":[],"mappings":"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"}
|
package/dist/changeset.js
CHANGED
|
@@ -46,11 +46,11 @@ class ChangeSet {
|
|
|
46
46
|
if (in_changes === undefined || in_changes === null) {
|
|
47
47
|
this._changes = {};
|
|
48
48
|
}
|
|
49
|
-
else if (isString_1.default(in_changes)) { // Stringified Serialized JSON
|
|
49
|
+
else if ((0, isString_1.default)(in_changes)) { // Stringified Serialized JSON
|
|
50
50
|
this._changes = JSON.parse(in_changes);
|
|
51
51
|
}
|
|
52
52
|
else if (in_changes instanceof ChangeSet) {
|
|
53
|
-
this._changes = fastest_json_copy_1.copy(in_changes._changes);
|
|
53
|
+
this._changes = (0, fastest_json_copy_1.copy)(in_changes._changes);
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
// Serialized Changeset
|
|
@@ -97,7 +97,7 @@ class ChangeSet {
|
|
|
97
97
|
* @returns The cloned ChangeSet
|
|
98
98
|
*/
|
|
99
99
|
clone() {
|
|
100
|
-
return new ChangeSet(fastest_json_copy_1.copy(this._changes));
|
|
100
|
+
return new ChangeSet((0, fastest_json_copy_1.copy)(this._changes));
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Updates this ChangeSet. The result will be the concatenation of the two ChangeSets. First the changes in this
|
|
@@ -113,8 +113,8 @@ class ChangeSet {
|
|
|
113
113
|
if (in_changeSet instanceof ChangeSet) {
|
|
114
114
|
changes = in_changeSet.getSerializedChangeSet();
|
|
115
115
|
}
|
|
116
|
-
if (!isObject_1.default(this._changes) || Array.isArray(this._changes)) {
|
|
117
|
-
const oldValue = isObject_1.default(changes) && changes.value !== undefined ? changes.value : changes;
|
|
116
|
+
if (!(0, isObject_1.default)(this._changes) || Array.isArray(this._changes)) {
|
|
117
|
+
const oldValue = (0, isObject_1.default)(changes) && changes.value !== undefined ? changes.value : changes;
|
|
118
118
|
this._changes = Array.isArray(oldValue) ? oldValue.slice() : oldValue;
|
|
119
119
|
}
|
|
120
120
|
else {
|
|
@@ -138,9 +138,9 @@ class ChangeSet {
|
|
|
138
138
|
in_appliedPropertyChanges.remove) {
|
|
139
139
|
this._performApplyAfterOnPropertyIndexedCollection(io_basePropertyChanges, in_appliedPropertyChanges, "NodeProperty", in_options); // TODO: recursively propagate the typeid?
|
|
140
140
|
}
|
|
141
|
-
if (!isEmpty_1.default(in_appliedPropertyChanges.insertTemplates)) {
|
|
141
|
+
if (!(0, isEmpty_1.default)(in_appliedPropertyChanges.insertTemplates)) {
|
|
142
142
|
io_basePropertyChanges.insertTemplates = io_basePropertyChanges.insertTemplates || {};
|
|
143
|
-
extend_1.default(io_basePropertyChanges.insertTemplates, in_appliedPropertyChanges.insertTemplates);
|
|
143
|
+
(0, extend_1.default)(io_basePropertyChanges.insertTemplates, in_appliedPropertyChanges.insertTemplates);
|
|
144
144
|
}
|
|
145
145
|
// Apply ChangeSet to the properties
|
|
146
146
|
const modifiedTypeids = Object.keys(in_appliedPropertyChanges);
|
|
@@ -157,7 +157,7 @@ class ChangeSet {
|
|
|
157
157
|
this.performApplyAfterOnPropertyWithTypeid(changedKeys[j], baseChanges, in_appliedPropertyChanges[typeid], typeid, in_removeEmpty, in_options);
|
|
158
158
|
}
|
|
159
159
|
// Remove the type when it no longer contains any changed keys
|
|
160
|
-
if (in_removeEmpty && isEmpty_1.default(io_basePropertyChanges[typeid])) {
|
|
160
|
+
if (in_removeEmpty && (0, isEmpty_1.default)(io_basePropertyChanges[typeid])) {
|
|
161
161
|
delete io_basePropertyChanges[typeid];
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -209,7 +209,7 @@ class ChangeSet {
|
|
|
209
209
|
in_baseChanges[in_changedKey] = in_baseChanges[in_changedKey] || {};
|
|
210
210
|
this._performApplyAfterOnPropertyIndexedCollection(in_baseChanges[in_changedKey], in_appliedPropertyChanges[in_changedKey], splitTypeid.typeid, in_options);
|
|
211
211
|
// Remove the key, when it no longer contains a changeset
|
|
212
|
-
if (in_removeEmpty && isEmpty_1.default(in_baseChanges[in_changedKey])) {
|
|
212
|
+
if (in_removeEmpty && (0, isEmpty_1.default)(in_baseChanges[in_changedKey])) {
|
|
213
213
|
delete in_baseChanges[in_changedKey];
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -218,7 +218,7 @@ class ChangeSet {
|
|
|
218
218
|
let baseIsSetChange = false;
|
|
219
219
|
let oldValue;
|
|
220
220
|
if (splitTypeid.typeid === "String" &&
|
|
221
|
-
(isString_1.default(in_baseChanges[in_changedKey]) ||
|
|
221
|
+
((0, isString_1.default)(in_baseChanges[in_changedKey]) ||
|
|
222
222
|
(in_baseChanges[in_changedKey] && in_baseChanges[in_changedKey].hasOwnProperty("value")))) {
|
|
223
223
|
oldValue = in_baseChanges[in_changedKey].oldValue;
|
|
224
224
|
// we need to convert the format to allow the application of the changes
|
|
@@ -240,10 +240,10 @@ class ChangeSet {
|
|
|
240
240
|
baseIsSetChange = true;
|
|
241
241
|
}
|
|
242
242
|
let appliedChanges = in_appliedPropertyChanges[in_changedKey];
|
|
243
|
-
if (isObject_1.default(appliedChanges) && appliedChanges.hasOwnProperty("value")) {
|
|
243
|
+
if ((0, isObject_1.default)(appliedChanges) && appliedChanges.hasOwnProperty("value")) {
|
|
244
244
|
appliedChanges = appliedChanges.value;
|
|
245
245
|
}
|
|
246
|
-
if (splitTypeid.typeid === "String" && isString_1.default(appliedChanges)) {
|
|
246
|
+
if (splitTypeid.typeid === "String" && (0, isString_1.default)(appliedChanges)) {
|
|
247
247
|
// we've got a 'set' command and just overwrite the changes
|
|
248
248
|
if (baseIsSetChange && oldValue !== undefined) {
|
|
249
249
|
in_baseChanges[in_changedKey] = {
|
|
@@ -261,7 +261,7 @@ class ChangeSet {
|
|
|
261
261
|
if (baseIsSetChange) {
|
|
262
262
|
// we have to convert back to a string, if it had been converted before
|
|
263
263
|
let newValue;
|
|
264
|
-
if (isEmpty_1.default(in_baseChanges[in_changedKey])) {
|
|
264
|
+
if ((0, isEmpty_1.default)(in_baseChanges[in_changedKey])) {
|
|
265
265
|
newValue = "";
|
|
266
266
|
}
|
|
267
267
|
else {
|
|
@@ -309,7 +309,7 @@ class ChangeSet {
|
|
|
309
309
|
}
|
|
310
310
|
else {
|
|
311
311
|
// If the key doesn't exist, yet, we can just copy it
|
|
312
|
-
in_baseChanges[in_changedKey] = fastest_json_copy_1.copy(in_appliedPropertyChanges[in_changedKey]);
|
|
312
|
+
in_baseChanges[in_changedKey] = (0, fastest_json_copy_1.copy)(in_appliedPropertyChanges[in_changedKey]);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
}
|
|
@@ -361,14 +361,14 @@ class ChangeSet {
|
|
|
361
361
|
false, // don't use square brackets (use dots instead)
|
|
362
362
|
out_conflicts, in_options);
|
|
363
363
|
}
|
|
364
|
-
if (!isEmpty_1.default(io_rebasePropertyChangeSet.insertTemplates)) {
|
|
364
|
+
if (!(0, isEmpty_1.default)(io_rebasePropertyChangeSet.insertTemplates)) {
|
|
365
365
|
const typeids = Object.keys(io_rebasePropertyChangeSet.insertTemplates);
|
|
366
366
|
const templateMismatchChangeSet = { insertTemplates: {} };
|
|
367
367
|
const templateMismatchConflict = {
|
|
368
368
|
type: ChangeSet.ConflictType.MISMATCH_TEMPLATES,
|
|
369
369
|
conflictingChange: templateMismatchChangeSet,
|
|
370
370
|
};
|
|
371
|
-
each_1.default(typeids, function (typeid) {
|
|
371
|
+
(0, each_1.default)(typeids, function (typeid) {
|
|
372
372
|
const template = io_rebasePropertyChangeSet.insertTemplates[typeid];
|
|
373
373
|
if (in_ownPropertyChangeSet.insertTemplates &&
|
|
374
374
|
in_ownPropertyChangeSet.insertTemplates[typeid]) {
|
|
@@ -386,10 +386,10 @@ class ChangeSet {
|
|
|
386
386
|
}
|
|
387
387
|
});
|
|
388
388
|
// Remove insertTemplates key if it is empty
|
|
389
|
-
if (isEmpty_1.default(io_rebasePropertyChangeSet.insertTemplates)) {
|
|
389
|
+
if ((0, isEmpty_1.default)(io_rebasePropertyChangeSet.insertTemplates)) {
|
|
390
390
|
delete io_rebasePropertyChangeSet.insertTemplates;
|
|
391
391
|
}
|
|
392
|
-
if (!isEmpty_1.default(templateMismatchConflict.conflictingChange.insertTemplates)) {
|
|
392
|
+
if (!(0, isEmpty_1.default)(templateMismatchConflict.conflictingChange.insertTemplates)) {
|
|
393
393
|
out_conflicts.push(templateMismatchConflict);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
@@ -412,7 +412,7 @@ class ChangeSet {
|
|
|
412
412
|
for (let z = 0; z < tempPaths.length; z++) {
|
|
413
413
|
if (tempPaths[z] in io_rebasePropertyChangeSet.modify[tempTypeid]) {
|
|
414
414
|
let rebasedPropContent = io_rebasePropertyChangeSet.modify[tempTypeid][tempPaths[z]];
|
|
415
|
-
if (isObject_1.default(rebasedPropContent) && "oldValue" in rebasedPropContent) {
|
|
415
|
+
if ((0, isObject_1.default)(rebasedPropContent) && "oldValue" in rebasedPropContent) {
|
|
416
416
|
rebasedPropContent.oldValue = in_ownPropertyChangeSet.modify[tempTypeid][tempPaths[z]].value;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
@@ -427,7 +427,7 @@ class ChangeSet {
|
|
|
427
427
|
for (let j = 0; j < paths.length; j++) {
|
|
428
428
|
if (typeid in io_rebasePropertyChangeSet && paths[j] in io_rebasePropertyChangeSet[typeid]) {
|
|
429
429
|
let rebasedPropContent = io_rebasePropertyChangeSet[typeid][paths[j]];
|
|
430
|
-
if (isObject_1.default(rebasedPropContent) && "oldValue" in rebasedPropContent) {
|
|
430
|
+
if ((0, isObject_1.default)(rebasedPropContent) && "oldValue" in rebasedPropContent) {
|
|
431
431
|
// if oldValue already be update above, we don't need to update
|
|
432
432
|
if (io_rebasePropertyChangeSet[typeid][paths[j]].oldValue !==
|
|
433
433
|
in_ownPropertyChangeSet[typeid][paths[j]].value) {
|
|
@@ -447,7 +447,7 @@ class ChangeSet {
|
|
|
447
447
|
for (let j = 0; j < paths.length; j++) {
|
|
448
448
|
if (io_rebasePropertyChangeSet[typeid][paths[j]] !== undefined) {
|
|
449
449
|
in_ownPropertyChangeSet[typeid] = in_ownPropertyChangeSet[typeid] || {};
|
|
450
|
-
const newPath = property_common_1.joinPaths(in_basePath, paths[j], PROPERTY_PATH_DELIMITER);
|
|
450
|
+
const newPath = (0, property_common_1.joinPaths)(in_basePath, paths[j], PROPERTY_PATH_DELIMITER);
|
|
451
451
|
// Perform the rebase operation on the ChangeSet for this entry
|
|
452
452
|
const setConflict = this.rebaseChangeSetForPropertyEntryWithTypeid(paths[j], in_ownPropertyChangeSet[typeid], io_rebasePropertyChangeSet[typeid], typeid, newPath, true, out_conflicts, in_options);
|
|
453
453
|
// If there has been a non-recursive set collision we handle it here separately
|
|
@@ -456,17 +456,17 @@ class ChangeSet {
|
|
|
456
456
|
changeSet[typeid] = changeSet[typeid] || {};
|
|
457
457
|
// Store the change. Note: We make a deep copy here, as this is a reference into our
|
|
458
458
|
// own internal ChangeSet and we want to be sure, nobody changes our internal data-structures
|
|
459
|
-
changeSet[typeid][paths[j]] = fastest_json_copy_1.copy(in_ownPropertyChangeSet[typeid][paths[j]]);
|
|
459
|
+
changeSet[typeid][paths[j]] = (0, fastest_json_copy_1.copy)(in_ownPropertyChangeSet[typeid][paths[j]]);
|
|
460
460
|
}
|
|
461
461
|
// Remove the typeid, when it no longer contains any keys
|
|
462
|
-
if (isEmpty_1.default(io_rebasePropertyChangeSet[typeid])) {
|
|
462
|
+
if ((0, isEmpty_1.default)(io_rebasePropertyChangeSet[typeid])) {
|
|
463
463
|
delete io_rebasePropertyChangeSet[typeid];
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
// If there were conflicts in the set operations, report them
|
|
469
|
-
if (!isEmpty_1.default(changeSet)) {
|
|
469
|
+
if (!(0, isEmpty_1.default)(changeSet)) {
|
|
470
470
|
const conflict = {
|
|
471
471
|
path: in_basePath,
|
|
472
472
|
type: ChangeSet.ConflictType.COLLIDING_SET,
|
|
@@ -503,21 +503,21 @@ class ChangeSet {
|
|
|
503
503
|
this._rebaseIndexedCollectionChangeSetForProperty(in_ownPropertyChangeSet[in_key], io_rebasePropertyChangeSet[in_key], in_basePath, splitTypeid.typeid, true, // use square brackets
|
|
504
504
|
out_conflicts, in_options);
|
|
505
505
|
// Remove the key, when it no longer contains a changeset
|
|
506
|
-
if (in_removeEmpty && isEmpty_1.default(io_rebasePropertyChangeSet[in_key])) {
|
|
506
|
+
if (in_removeEmpty && (0, isEmpty_1.default)(io_rebasePropertyChangeSet[in_key])) {
|
|
507
507
|
delete io_rebasePropertyChangeSet[in_key];
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
else if (splitTypeid.context === "array") {
|
|
511
511
|
this._rebaseArrayChangeSetForProperty(in_ownPropertyChangeSet[in_key], io_rebasePropertyChangeSet[in_key], in_basePath, out_conflicts, splitTypeid.typeid, in_options);
|
|
512
512
|
// Remove the key, when it no longer contains a changeset
|
|
513
|
-
if (in_removeEmpty && isEmpty_1.default(io_rebasePropertyChangeSet[in_key])) {
|
|
513
|
+
if (in_removeEmpty && (0, isEmpty_1.default)(io_rebasePropertyChangeSet[in_key])) {
|
|
514
514
|
delete io_rebasePropertyChangeSet[in_key];
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
else if (splitTypeid.typeid === "String") {
|
|
518
518
|
this._rebaseChangeSetForString(in_ownPropertyChangeSet[in_key], io_rebasePropertyChangeSet, in_key, in_basePath, out_conflicts, in_options);
|
|
519
519
|
// Remove the key, when it no longer contains a changeset
|
|
520
|
-
if (in_removeEmpty && isEmpty_1.default(io_rebasePropertyChangeSet[in_key])) {
|
|
520
|
+
if (in_removeEmpty && (0, isEmpty_1.default)(io_rebasePropertyChangeSet[in_key])) {
|
|
521
521
|
delete io_rebasePropertyChangeSet[in_key];
|
|
522
522
|
}
|
|
523
523
|
}
|
|
@@ -579,10 +579,10 @@ class ChangeSet {
|
|
|
579
579
|
}
|
|
580
580
|
let oldValue = current;
|
|
581
581
|
// store it in reversibleChangeSet
|
|
582
|
-
if (type === "String" && !isString_1.default(nestedChangeset)) {
|
|
582
|
+
if (type === "String" && !(0, isString_1.default)(nestedChangeset)) {
|
|
583
583
|
// String is a special case
|
|
584
584
|
let oldString;
|
|
585
|
-
if (isString_1.default(oldValue)) {
|
|
585
|
+
if ((0, isString_1.default)(oldValue)) {
|
|
586
586
|
oldString = oldValue;
|
|
587
587
|
}
|
|
588
588
|
if (nestedChangeset.modify) {
|
|
@@ -598,7 +598,7 @@ class ChangeSet {
|
|
|
598
598
|
let entry = nestedChangeset.remove[i];
|
|
599
599
|
let entryOffset = entry[0];
|
|
600
600
|
let removeRangeLength = entry[1];
|
|
601
|
-
if (isString_1.default(removeRangeLength)) {
|
|
601
|
+
if ((0, isString_1.default)(removeRangeLength)) {
|
|
602
602
|
removeRangeLength = entry[1].length;
|
|
603
603
|
}
|
|
604
604
|
entry[1] = oldString.slice(entryOffset, entryOffset + removeRangeLength);
|
|
@@ -631,7 +631,7 @@ class ChangeSet {
|
|
|
631
631
|
let entryOffset = entry[0];
|
|
632
632
|
let oldEntries = [];
|
|
633
633
|
for (let j = 0; j < entry[1].length; j++) {
|
|
634
|
-
oldEntries.push(fastest_json_copy_1.copy(oldValue[entryOffset + j]));
|
|
634
|
+
oldEntries.push((0, fastest_json_copy_1.copy)(oldValue[entryOffset + j]));
|
|
635
635
|
}
|
|
636
636
|
entry[2] = oldEntries;
|
|
637
637
|
}
|
|
@@ -647,7 +647,7 @@ class ChangeSet {
|
|
|
647
647
|
removeRangeLength = entry[1].length;
|
|
648
648
|
}
|
|
649
649
|
for (let j = 0; j < removeRangeLength; j++) {
|
|
650
|
-
oldEntries.push(fastest_json_copy_1.copy(oldValue[entryOffset + j]));
|
|
650
|
+
oldEntries.push((0, fastest_json_copy_1.copy)(oldValue[entryOffset + j]));
|
|
651
651
|
}
|
|
652
652
|
entry[1] = oldEntries;
|
|
653
653
|
}
|
|
@@ -680,7 +680,7 @@ class ChangeSet {
|
|
|
680
680
|
}
|
|
681
681
|
nestedChangeset.modify[modifiedKeys[i]] = {
|
|
682
682
|
value: entry,
|
|
683
|
-
oldValue: fastest_json_copy_1.copy(oldValue[modifiedKeys[i]]),
|
|
683
|
+
oldValue: (0, fastest_json_copy_1.copy)(oldValue[modifiedKeys[i]]),
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
686
|
}
|
|
@@ -691,7 +691,7 @@ class ChangeSet {
|
|
|
691
691
|
removedKeys = Object.keys(removedKeys);
|
|
692
692
|
}
|
|
693
693
|
for (let i = 0; i < removedKeys.length; i++) {
|
|
694
|
-
newRemove[removedKeys[i]] = fastest_json_copy_1.copy(oldValue[removedKeys[i]]);
|
|
694
|
+
newRemove[removedKeys[i]] = (0, fastest_json_copy_1.copy)(oldValue[removedKeys[i]]);
|
|
695
695
|
}
|
|
696
696
|
nestedChangeset.remove = newRemove;
|
|
697
697
|
}
|
|
@@ -715,7 +715,7 @@ class ChangeSet {
|
|
|
715
715
|
if (!newRemove[oldTypeKeys[k]]) {
|
|
716
716
|
newRemove[oldTypeKeys[k]] = {};
|
|
717
717
|
}
|
|
718
|
-
newRemove[oldTypeKeys[k]][removedKeys[i]] = fastest_json_copy_1.copy(entry);
|
|
718
|
+
newRemove[oldTypeKeys[k]][removedKeys[i]] = (0, fastest_json_copy_1.copy)(entry);
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
}
|
|
@@ -748,8 +748,8 @@ class ChangeSet {
|
|
|
748
748
|
*/
|
|
749
749
|
_toReversibleChangeSet(in_oldSerializedState) {
|
|
750
750
|
property_common_1.ConsoleUtils.assert(in_oldSerializedState !== undefined, `${MSG.ASSERTION_FAILED}Missing function parameter "in_oldSerializedState" of "_toReversibleChangeSet".`);
|
|
751
|
-
if (!isObject_1.default(in_oldSerializedState) || Array.isArray(in_oldSerializedState)) {
|
|
752
|
-
if (!isObject_1.default(this._changes) || Array.isArray(this._changes)) {
|
|
751
|
+
if (!(0, isObject_1.default)(in_oldSerializedState) || Array.isArray(in_oldSerializedState)) {
|
|
752
|
+
if (!(0, isObject_1.default)(this._changes) || Array.isArray(this._changes)) {
|
|
753
753
|
this._changes = {
|
|
754
754
|
oldValue: Array.isArray(in_oldSerializedState) ? in_oldSerializedState.slice() : in_oldSerializedState,
|
|
755
755
|
value: this._changes,
|
|
@@ -787,7 +787,7 @@ class ChangeSet {
|
|
|
787
787
|
if (isPrimitiveType(type)) {
|
|
788
788
|
// remove old state
|
|
789
789
|
let nestedChangeset = in_context.getNestedChangeSet();
|
|
790
|
-
if (type === "String" && !isString_1.default(nestedChangeset)) {
|
|
790
|
+
if (type === "String" && !(0, isString_1.default)(nestedChangeset)) {
|
|
791
791
|
// String is a special case
|
|
792
792
|
if (nestedChangeset.modify) {
|
|
793
793
|
for (let i = 0; i < nestedChangeset.modify.length; i++) {
|
|
@@ -799,7 +799,7 @@ class ChangeSet {
|
|
|
799
799
|
for (let i = 0; i < nestedChangeset.remove.length; i++) {
|
|
800
800
|
let entry = nestedChangeset.remove[i];
|
|
801
801
|
let removeRangeLength = entry[1];
|
|
802
|
-
if (isString_1.default(removeRangeLength)) {
|
|
802
|
+
if ((0, isString_1.default)(removeRangeLength)) {
|
|
803
803
|
removeRangeLength = entry[1].length;
|
|
804
804
|
}
|
|
805
805
|
entry[1] = removeRangeLength;
|
|
@@ -878,7 +878,7 @@ class ChangeSet {
|
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
};
|
|
881
|
-
if (isObject_1.default(this._changes) &&
|
|
881
|
+
if ((0, isObject_1.default)(this._changes) &&
|
|
882
882
|
this._changes.oldValue !== undefined &&
|
|
883
883
|
this._changes.value !== undefined) {
|
|
884
884
|
this._changes = this._changes.value;
|
|
@@ -902,8 +902,8 @@ class ChangeSet {
|
|
|
902
902
|
}
|
|
903
903
|
else {
|
|
904
904
|
paths = [];
|
|
905
|
-
each_1.default(in_changeSet, function (nestedChangeSet) {
|
|
906
|
-
each_1.default(nestedChangeSet, function (nestedChangeSet2, path) {
|
|
905
|
+
(0, each_1.default)(in_changeSet, function (nestedChangeSet) {
|
|
906
|
+
(0, each_1.default)(nestedChangeSet, function (nestedChangeSet2, path) {
|
|
907
907
|
paths.push(path);
|
|
908
908
|
});
|
|
909
909
|
});
|
|
@@ -933,10 +933,10 @@ class ChangeSet {
|
|
|
933
933
|
}
|
|
934
934
|
const nestedChangeset = in_context.getNestedChangeSet();
|
|
935
935
|
if ((isPrimitiveType(type) && type !== "String") ||
|
|
936
|
-
(type === "String" && isString_1.default(nestedChangeset.oldValue))) {
|
|
936
|
+
(type === "String" && (0, isString_1.default)(nestedChangeset.oldValue))) {
|
|
937
937
|
// check if we were called with an irreversible changeset
|
|
938
938
|
if (in_context.getOperationType() === "modify" &&
|
|
939
|
-
(!isObject_1.default(nestedChangeset) || typeof nestedChangeset.oldValue === "undefined")) {
|
|
939
|
+
(!(0, isObject_1.default)(nestedChangeset) || typeof nestedChangeset.oldValue === "undefined")) {
|
|
940
940
|
throw new Error(MSG.OLD_VALUE_NOT_FOUND);
|
|
941
941
|
}
|
|
942
942
|
// switch oldValue and value
|
|
@@ -944,7 +944,7 @@ class ChangeSet {
|
|
|
944
944
|
nestedChangeset.oldValue = nestedChangeset.value;
|
|
945
945
|
nestedChangeset.value = tmp;
|
|
946
946
|
}
|
|
947
|
-
else if ((type === "String" && !isString_1.default(nestedChangeset.oldValue)) || splitType.context === "array") {
|
|
947
|
+
else if ((type === "String" && !(0, isString_1.default)(nestedChangeset.oldValue)) || splitType.context === "array") {
|
|
948
948
|
// String and Arrays need special treatment:
|
|
949
949
|
const arrayIterator = new arrayChangesetIterator_1.ArrayChangeSetIterator(nestedChangeset);
|
|
950
950
|
const resultChangeset = {};
|
|
@@ -1018,14 +1018,14 @@ class ChangeSet {
|
|
|
1018
1018
|
nestedChangeset.remove = undefined;
|
|
1019
1019
|
delete nestedChangeset.remove;
|
|
1020
1020
|
const isPrimitiveTypeid = isPrimitiveType(in_context.getSplitTypeID().typeid);
|
|
1021
|
-
each_1.default(this._extractFirstLevelPaths(nestedChangeset.insert, isPrimitiveTypeid), function (path) {
|
|
1022
|
-
const fullPath = property_common_1.joinPaths(in_context.getFullPath(), path, PROPERTY_PATH_DELIMITER);
|
|
1021
|
+
(0, each_1.default)(this._extractFirstLevelPaths(nestedChangeset.insert, isPrimitiveTypeid), function (path) {
|
|
1022
|
+
const fullPath = (0, property_common_1.joinPaths)(in_context.getFullPath(), path, PROPERTY_PATH_DELIMITER);
|
|
1023
1023
|
in_context.getUserData()[fullPath] = true;
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
1026
1026
|
if (oldInsert) {
|
|
1027
1027
|
if (replacedInsert) {
|
|
1028
|
-
nestedChangeset.remove = fastest_json_copy_1.copy(oldInsert);
|
|
1028
|
+
nestedChangeset.remove = (0, fastest_json_copy_1.copy)(oldInsert);
|
|
1029
1029
|
}
|
|
1030
1030
|
else {
|
|
1031
1031
|
nestedChangeset.remove = oldInsert;
|
|
@@ -1033,8 +1033,8 @@ class ChangeSet {
|
|
|
1033
1033
|
delete nestedChangeset.insert;
|
|
1034
1034
|
}
|
|
1035
1035
|
const isPrimitiveTypeid = isPrimitiveType(in_context.getSplitTypeID().typeid);
|
|
1036
|
-
each_1.default(this._extractFirstLevelPaths(nestedChangeset.remove, isPrimitiveTypeid), function (path) {
|
|
1037
|
-
const fullPath = property_common_1.joinPaths(in_context.getFullPath(), path, PROPERTY_PATH_DELIMITER);
|
|
1036
|
+
(0, each_1.default)(this._extractFirstLevelPaths(nestedChangeset.remove, isPrimitiveTypeid), function (path) {
|
|
1037
|
+
const fullPath = (0, property_common_1.joinPaths)(in_context.getFullPath(), path, PROPERTY_PATH_DELIMITER);
|
|
1038
1038
|
in_context.getUserData()[fullPath] = true;
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|