@fluid-experimental/property-changeset 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.3.1.0.125672

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.
Files changed (114) hide show
  1. package/README.md +1 -0
  2. package/dist/changeset.d.ts +2 -2
  3. package/dist/changeset.d.ts.map +1 -1
  4. package/dist/changeset.js +61 -45
  5. package/dist/changeset.js.map +1 -1
  6. package/dist/changeset_operations/array.d.ts +6 -6
  7. package/dist/changeset_operations/array.d.ts.map +1 -1
  8. package/dist/changeset_operations/array.js +87 -56
  9. package/dist/changeset_operations/array.js.map +1 -1
  10. package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  11. package/dist/changeset_operations/arrayChangesetIterator.js +43 -41
  12. package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
  13. package/dist/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
  14. package/dist/changeset_operations/changesetConflictTypes.js.map +1 -1
  15. package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
  16. package/dist/changeset_operations/indexedCollection.js +76 -44
  17. package/dist/changeset_operations/indexedCollection.js.map +1 -1
  18. package/dist/changeset_operations/isEmptyChangeset.d.ts.map +1 -1
  19. package/dist/changeset_operations/isEmptyChangeset.js +2 -1
  20. package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
  21. package/dist/changeset_operations/operationTypes.d.ts.map +1 -1
  22. package/dist/changeset_operations/operationTypes.js.map +1 -1
  23. package/dist/helpers/typeidHelper.d.ts +10 -10
  24. package/dist/helpers/typeidHelper.d.ts.map +1 -1
  25. package/dist/helpers/typeidHelper.js +19 -17
  26. package/dist/helpers/typeidHelper.js.map +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/isReservedKeyword.d.ts.map +1 -1
  30. package/dist/isReservedKeyword.js.map +1 -1
  31. package/dist/pathHelper.d.ts.map +1 -1
  32. package/dist/pathHelper.js +16 -10
  33. package/dist/pathHelper.js.map +1 -1
  34. package/dist/rebase.d.ts.map +1 -1
  35. package/dist/rebase.js +20 -13
  36. package/dist/rebase.js.map +1 -1
  37. package/dist/templateSchema.d.ts.map +1 -1
  38. package/dist/templateSchema.js +10 -11
  39. package/dist/templateSchema.js.map +1 -1
  40. package/dist/templateValidator.d.ts +0 -5
  41. package/dist/templateValidator.d.ts.map +1 -1
  42. package/dist/templateValidator.js +140 -108
  43. package/dist/templateValidator.js.map +1 -1
  44. package/dist/test/array.spec.js +142 -345
  45. package/dist/test/array.spec.js.map +1 -1
  46. package/dist/test/pathHelper.spec.js +299 -166
  47. package/dist/test/pathHelper.spec.js.map +1 -1
  48. package/dist/test/reversibleCs.spec.js.map +1 -1
  49. package/dist/test/schemaValidator.js +3 -1
  50. package/dist/test/schemaValidator.js.map +1 -1
  51. package/dist/test/schemas/badBothPropertiesAndTypeid.js +8 -8
  52. package/dist/test/schemas/badBothPropertiesAndTypeid.js.map +1 -1
  53. package/dist/test/schemas/badInvalidSemverInTypeid.js +18 -16
  54. package/dist/test/schemas/badInvalidSemverInTypeid.js.map +1 -1
  55. package/dist/test/schemas/badMissingSemverInTypeid.js +18 -16
  56. package/dist/test/schemas/badMissingSemverInTypeid.js.map +1 -1
  57. package/dist/test/schemas/badNestedProperties.js +18 -17
  58. package/dist/test/schemas/badNestedProperties.js.map +1 -1
  59. package/dist/test/schemas/badPrimitiveTypeid.js +9 -8
  60. package/dist/test/schemas/badPrimitiveTypeid.js.map +1 -1
  61. package/dist/test/schemas/badVersionedTypeid.js +19 -17
  62. package/dist/test/schemas/badVersionedTypeid.js.map +1 -1
  63. package/dist/test/schemas/goodColorPalette.js +4 -4
  64. package/dist/test/schemas/goodColorPalette.js.map +1 -1
  65. package/dist/test/schemas/goodDraftAsVersion.js +2 -4
  66. package/dist/test/schemas/goodDraftAsVersion.js.map +1 -1
  67. package/dist/test/schemas/goodPointId.js +18 -16
  68. package/dist/test/schemas/goodPointId.js.map +1 -1
  69. package/dist/test/schemas/goodReferenceAndRegular.js +5 -5
  70. package/dist/test/schemas/goodReferenceAndRegular.js.map +1 -1
  71. package/dist/test/schemas/goodReservedTypes.js +8 -7
  72. package/dist/test/schemas/goodReservedTypes.js.map +1 -1
  73. package/dist/test/schemas/goodUIBorder.js +19 -16
  74. package/dist/test/schemas/goodUIBorder.js.map +1 -1
  75. package/dist/test/tsconfig.tsbuildinfo +1 -1
  76. package/dist/test/validator/templateSyntax.spec.js.map +1 -1
  77. package/dist/test/validator/templateValidator.spec.js +330 -309
  78. package/dist/test/validator/templateValidator.spec.js.map +1 -1
  79. package/dist/test/validator/typeidHelper.spec.js +99 -69
  80. package/dist/test/validator/typeidHelper.spec.js.map +1 -1
  81. package/dist/utils.d.ts +1 -1
  82. package/dist/utils.d.ts.map +1 -1
  83. package/dist/utils.js +149 -95
  84. package/dist/utils.js.map +1 -1
  85. package/dist/validationResultBuilder.d.ts.map +1 -1
  86. package/dist/validationResultBuilder.js.map +1 -1
  87. package/lib/changeset.js +63 -47
  88. package/lib/changeset.js.map +1 -1
  89. package/lib/changeset_operations/array.js +88 -57
  90. package/lib/changeset_operations/array.js.map +1 -1
  91. package/lib/changeset_operations/arrayChangesetIterator.js +43 -41
  92. package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
  93. package/lib/changeset_operations/changesetConflictTypes.js.map +1 -1
  94. package/lib/changeset_operations/indexedCollection.js +76 -44
  95. package/lib/changeset_operations/indexedCollection.js.map +1 -1
  96. package/lib/changeset_operations/isEmptyChangeset.js +2 -1
  97. package/lib/changeset_operations/isEmptyChangeset.js.map +1 -1
  98. package/lib/changeset_operations/operationTypes.js.map +1 -1
  99. package/lib/helpers/typeidHelper.js +19 -17
  100. package/lib/helpers/typeidHelper.js.map +1 -1
  101. package/lib/index.js.map +1 -1
  102. package/lib/isReservedKeyword.js.map +1 -1
  103. package/lib/pathHelper.js +17 -11
  104. package/lib/pathHelper.js.map +1 -1
  105. package/lib/rebase.js +20 -13
  106. package/lib/rebase.js.map +1 -1
  107. package/lib/templateSchema.js +10 -11
  108. package/lib/templateSchema.js.map +1 -1
  109. package/lib/templateValidator.js +135 -103
  110. package/lib/templateValidator.js.map +1 -1
  111. package/lib/utils.js +149 -95
  112. package/lib/utils.js.map +1 -1
  113. package/lib/validationResultBuilder.js.map +1 -1
  114. package/package.json +8 -8
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # @fluid-experimental/property-changeset
2
2
 
3
3
  ## Overview
4
+
4
5
  This package contains the Changeset class and template validators.
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @fileoverview Serialized representation of the changes in a repository
7
7
  */
8
- import { ChangeSetArrayFunctions } from './changeset_operations/array';
9
- import { ConflictType } from './changeset_operations/changesetConflictTypes';
8
+ import { ChangeSetArrayFunctions } from "./changeset_operations/array";
9
+ import { ConflictType } from "./changeset_operations/changesetConflictTypes";
10
10
  import { ChangeSetIndexedCollectionFunctions } from "./changeset_operations/indexedCollection";
11
11
  export interface ApplyChangeSetOptions {
12
12
  /**
@@ -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,CAAC;CACrC;AAED,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACjE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,oBAAY,mBAAmB,GAAG,GAAG,CAAC;AACtC,oBAAY,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pC;;;;;;;;OAQG;IACH,OAAO,CAAC,WAAW;IA2BnB;;;;;;;;;;;OAWG;IACI,qCAAqC,CAC3C,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,mBAAmB,EACnC,yBAAyB,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAC/C,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,OAAO,EACvB,UAAU,CAAC,EAAE,qBAAqB;IAsInC;;;;;;;;;;;;OAYG;IACI,gBAAgB,CACtB,YAAY,EAAE,mBAAmB,EACjC,aAAa,EAAE,YAAY,EAAE,EAC7B,UAAU,CAAC,EAAE,sBAAsB,GACjC,mBAAmB;IAWtB;;;;;;;;;OASG;IACH,OAAO,CAAC,2BAA2B;IA8LnC;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,yCAAyC;IAiFjD;;;;;OAKG;IACH,OAAO,CAAC,oCAAoC;IAqN5C;;;;;;;OAOG;IACI,sBAAsB,CAAC,qBAAqB,EAAE,mBAAmB;IA8BxE;;;;;;OAMG;IACI,yBAAyB,CAAC,cAAc,EAAE,OAAO;IA0HxD;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;IAmB/B;;;OAGG;IACH,OAAO,CAAC,qCAAqC;IAsK7C;;;;;OAKG;IACI,kBAAkB;CAWzB"}
package/dist/changeset.js CHANGED
@@ -46,7 +46,8 @@ class ChangeSet {
46
46
  if (in_changes === undefined || in_changes === null) {
47
47
  this._changes = {};
48
48
  }
49
- else if ((0, isString_1.default)(in_changes)) { // Stringified Serialized JSON
49
+ else if ((0, isString_1.default)(in_changes)) {
50
+ // Stringified Serialized JSON
50
51
  this._changes = JSON.parse(in_changes);
51
52
  }
52
53
  else if (in_changes instanceof ChangeSet) {
@@ -114,7 +115,9 @@ class ChangeSet {
114
115
  changes = in_changeSet.getSerializedChangeSet();
115
116
  }
116
117
  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
+ const oldValue = (0, isObject_1.default)(changes) && changes.value !== undefined
119
+ ? changes.value
120
+ : changes;
118
121
  this._changes = Array.isArray(oldValue) ? oldValue.slice() : oldValue;
119
122
  }
120
123
  else {
@@ -172,14 +175,16 @@ class ChangeSet {
172
175
  * @param in_appliedValue - applied changes to be applied
173
176
  */
174
177
  _applyValue(io_baseChanges, in_baseKey, in_appliedValue) {
175
- const newValue = (in_appliedValue && in_appliedValue.hasOwnProperty("value")) ?
176
- in_appliedValue.value : in_appliedValue;
178
+ const newValue = in_appliedValue && in_appliedValue.hasOwnProperty("value")
179
+ ? in_appliedValue.value
180
+ : in_appliedValue;
177
181
  if (io_baseChanges[in_baseKey] && io_baseChanges[in_baseKey].hasOwnProperty("value")) {
178
182
  io_baseChanges[in_baseKey].value = newValue;
179
183
  }
180
184
  else {
181
185
  if (io_baseChanges[in_baseKey] === undefined &&
182
- in_appliedValue && in_appliedValue.hasOwnProperty("oldValue")) {
186
+ in_appliedValue &&
187
+ in_appliedValue.hasOwnProperty("oldValue")) {
183
188
  io_baseChanges[in_baseKey] = {
184
189
  value: newValue,
185
190
  oldValue: in_appliedValue.oldValue,
@@ -204,8 +209,7 @@ class ChangeSet {
204
209
  */
205
210
  performApplyAfterOnPropertyWithTypeid(in_changedKey, in_baseChanges, in_appliedPropertyChanges, in_typeid, in_removeEmpty, in_options) {
206
211
  const splitTypeid = extractContext(in_typeid);
207
- if (splitTypeid.context === "set" ||
208
- splitTypeid.context === "map") {
212
+ if (splitTypeid.context === "set" || splitTypeid.context === "map") {
209
213
  in_baseChanges[in_changedKey] = in_baseChanges[in_changedKey] || {};
210
214
  this._performApplyAfterOnPropertyIndexedCollection(in_baseChanges[in_changedKey], in_appliedPropertyChanges[in_changedKey], splitTypeid.typeid, in_options);
211
215
  // Remove the key, when it no longer contains a changeset
@@ -214,27 +218,26 @@ class ChangeSet {
214
218
  }
215
219
  }
216
220
  else if (splitTypeid.context === "array" || splitTypeid.typeid === "String") {
217
- in_baseChanges[in_changedKey] = in_baseChanges[in_changedKey] !== undefined ? in_baseChanges[in_changedKey] : {};
221
+ in_baseChanges[in_changedKey] =
222
+ in_baseChanges[in_changedKey] !== undefined ? in_baseChanges[in_changedKey] : {};
218
223
  let baseIsSetChange = false;
219
224
  let oldValue;
220
225
  if (splitTypeid.typeid === "String" &&
221
226
  ((0, isString_1.default)(in_baseChanges[in_changedKey]) ||
222
- (in_baseChanges[in_changedKey] && in_baseChanges[in_changedKey].hasOwnProperty("value")))) {
227
+ (in_baseChanges[in_changedKey] &&
228
+ in_baseChanges[in_changedKey].hasOwnProperty("value")))) {
223
229
  oldValue = in_baseChanges[in_changedKey].oldValue;
224
230
  // we need to convert the format to allow the application of the changes
225
231
  // since _performApplyAfterOnPropertyArray only understands insert/modify/remove commands
226
- if (in_baseChanges[in_changedKey] && in_baseChanges[in_changedKey].hasOwnProperty("value")) {
232
+ if (in_baseChanges[in_changedKey] &&
233
+ in_baseChanges[in_changedKey].hasOwnProperty("value")) {
227
234
  in_baseChanges[in_changedKey] = {
228
- insert: [
229
- [0, in_baseChanges[in_changedKey].value],
230
- ],
235
+ insert: [[0, in_baseChanges[in_changedKey].value]],
231
236
  };
232
237
  }
233
238
  else {
234
239
  in_baseChanges[in_changedKey] = {
235
- insert: [
236
- [0, in_baseChanges[in_changedKey]],
237
- ],
240
+ insert: [[0, in_baseChanges[in_changedKey]]],
238
241
  };
239
242
  }
240
243
  baseIsSetChange = true;
@@ -398,14 +401,16 @@ class ChangeSet {
398
401
  if (typeid === "modify" && "modify" in io_rebasePropertyChangeSet) {
399
402
  for (let j = 0; j < paths.length; j++) {
400
403
  const tempTypeid = paths[i];
401
- if ((isPrimitiveType(tempTypeid)) &&
404
+ if (isPrimitiveType(tempTypeid) &&
402
405
  tempTypeid in io_rebasePropertyChangeSet.modify) {
403
406
  const tempPaths = Object.keys(in_ownPropertyChangeSet.modify[tempTypeid]);
404
407
  for (let z = 0; z < tempPaths.length; z++) {
405
408
  if (tempPaths[z] in io_rebasePropertyChangeSet.modify[tempTypeid]) {
406
409
  let rebasedPropContent = io_rebasePropertyChangeSet.modify[tempTypeid][tempPaths[z]];
407
- if ((0, isObject_1.default)(rebasedPropContent) && "oldValue" in rebasedPropContent) {
408
- rebasedPropContent.oldValue = in_ownPropertyChangeSet.modify[tempTypeid][tempPaths[z]].value;
410
+ if ((0, isObject_1.default)(rebasedPropContent) &&
411
+ "oldValue" in rebasedPropContent) {
412
+ rebasedPropContent.oldValue =
413
+ in_ownPropertyChangeSet.modify[tempTypeid][tempPaths[z]].value;
409
414
  }
410
415
  }
411
416
  }
@@ -417,13 +422,15 @@ class ChangeSet {
417
422
  // io_rebasePropertyChangeSet && in_ownPropertyChangeSet contain only property type, name and value, we update
418
423
  // oldValue of io_rebasePropertyChangeSet.
419
424
  for (let j = 0; j < paths.length; j++) {
420
- if (typeid in io_rebasePropertyChangeSet && paths[j] in io_rebasePropertyChangeSet[typeid]) {
425
+ if (typeid in io_rebasePropertyChangeSet &&
426
+ paths[j] in io_rebasePropertyChangeSet[typeid]) {
421
427
  let rebasedPropContent = io_rebasePropertyChangeSet[typeid][paths[j]];
422
428
  if ((0, isObject_1.default)(rebasedPropContent) && "oldValue" in rebasedPropContent) {
423
429
  // if oldValue already be update above, we don't need to update
424
430
  if (io_rebasePropertyChangeSet[typeid][paths[j]].oldValue !==
425
431
  in_ownPropertyChangeSet[typeid][paths[j]].value) {
426
- io_rebasePropertyChangeSet[typeid][paths[j]].oldValue = in_ownPropertyChangeSet[typeid][paths[j]].value;
432
+ io_rebasePropertyChangeSet[typeid][paths[j]].oldValue =
433
+ in_ownPropertyChangeSet[typeid][paths[j]].value;
427
434
  }
428
435
  }
429
436
  }
@@ -431,8 +438,7 @@ class ChangeSet {
431
438
  }
432
439
  // The reserved keywords have already been handled above and changes which are not present in
433
440
  // the other ChangeSet can be ignored
434
- if (ChangeSet.isReservedKeyword(typeid) ||
435
- !io_rebasePropertyChangeSet[typeid]) {
441
+ if (ChangeSet.isReservedKeyword(typeid) || !io_rebasePropertyChangeSet[typeid]) {
436
442
  continue;
437
443
  }
438
444
  // Check, whether we have a collision in a path update
@@ -489,8 +495,7 @@ class ChangeSet {
489
495
  */
490
496
  rebaseChangeSetForPropertyEntryWithTypeid(in_key, in_ownPropertyChangeSet, io_rebasePropertyChangeSet, in_typeid, in_basePath, in_removeEmpty, out_conflicts, in_options) {
491
497
  const splitTypeid = extractContext(in_typeid);
492
- if (splitTypeid.context === "set" ||
493
- splitTypeid.context === "map") {
498
+ if (splitTypeid.context === "set" || splitTypeid.context === "map") {
494
499
  this._rebaseIndexedCollectionChangeSetForProperty(in_ownPropertyChangeSet[in_key], io_rebasePropertyChangeSet[in_key], in_basePath, splitTypeid.typeid, true, // use square brackets
495
500
  out_conflicts, in_options);
496
501
  // Remove the key, when it no longer contains a changeset
@@ -646,14 +651,13 @@ class ChangeSet {
646
651
  }
647
652
  else if (splitType.context === "map" ||
648
653
  // node property test: (we have to do the test this way, because of inheritance)
649
- (nestedChangeset.insert ||
650
- nestedChangeset.modify ||
651
- nestedChangeset.remove)) {
654
+ nestedChangeset.insert ||
655
+ nestedChangeset.modify ||
656
+ nestedChangeset.remove) {
652
657
  // This prevents an error, if the changeset only contains an insert operation. In that case
653
658
  // we don't actually need the corresponding old state and thus do not need to throw an error
654
659
  // This type of situation can occur in the materialized history, if an insert happens right at a chunk boundary.
655
- if (Object.keys(nestedChangeset).length === 1 &&
656
- nestedChangeset.insert) {
660
+ if (Object.keys(nestedChangeset).length === 1 && nestedChangeset.insert) {
657
661
  in_context._traversalStopped = true;
658
662
  return;
659
663
  }
@@ -706,7 +710,8 @@ class ChangeSet {
706
710
  if (!newRemove[oldTypeKeys[k]]) {
707
711
  newRemove[oldTypeKeys[k]] = {};
708
712
  }
709
- newRemove[oldTypeKeys[k]][removedKeys[i]] = (0, fastest_json_copy_1.copy)(entry);
713
+ newRemove[oldTypeKeys[k]][removedKeys[i]] =
714
+ (0, fastest_json_copy_1.copy)(entry);
710
715
  }
711
716
  }
712
717
  }
@@ -742,13 +747,16 @@ class ChangeSet {
742
747
  if (!(0, isObject_1.default)(in_oldSerializedState) || Array.isArray(in_oldSerializedState)) {
743
748
  if (!(0, isObject_1.default)(this._changes) || Array.isArray(this._changes)) {
744
749
  this._changes = {
745
- oldValue: Array.isArray(in_oldSerializedState) ? in_oldSerializedState.slice() : in_oldSerializedState,
750
+ oldValue: Array.isArray(in_oldSerializedState)
751
+ ? in_oldSerializedState.slice()
752
+ : in_oldSerializedState,
746
753
  value: this._changes,
747
754
  };
748
755
  }
749
756
  else {
750
- this._changes.oldValue = Array.isArray(in_oldSerializedState) ? in_oldSerializedState.slice() :
751
- in_oldSerializedState;
757
+ this._changes.oldValue = Array.isArray(in_oldSerializedState)
758
+ ? in_oldSerializedState.slice()
759
+ : in_oldSerializedState;
752
760
  }
753
761
  }
754
762
  else {
@@ -825,7 +833,8 @@ class ChangeSet {
825
833
  // TODO: Remove in_withoutRoot when it will not be used anymore
826
834
  }
827
835
  else if (splitType.context === "map" ||
828
- (!in_withoutRoot && splitType.context === "single")) { // For NodeProperty / inserts at the root
836
+ (!in_withoutRoot && splitType.context === "single")) {
837
+ // For NodeProperty / inserts at the root
829
838
  let nestedChangeset = in_context.getNestedChangeSet();
830
839
  if (isPrimitiveType(splitType.typeid)) {
831
840
  if (nestedChangeset.modify) {
@@ -927,7 +936,8 @@ class ChangeSet {
927
936
  (type === "String" && (0, isString_1.default)(nestedChangeset.oldValue))) {
928
937
  // check if we were called with an irreversible changeset
929
938
  if (in_context.getOperationType() === "modify" &&
930
- (!(0, isObject_1.default)(nestedChangeset) || typeof nestedChangeset.oldValue === "undefined")) {
939
+ (!(0, isObject_1.default)(nestedChangeset) ||
940
+ typeof nestedChangeset.oldValue === "undefined")) {
931
941
  throw new Error(MSG.OLD_VALUE_NOT_FOUND);
932
942
  }
933
943
  // switch oldValue and value
@@ -935,7 +945,8 @@ class ChangeSet {
935
945
  nestedChangeset.oldValue = nestedChangeset.value;
936
946
  nestedChangeset.value = tmp;
937
947
  }
938
- else if ((type === "String" && !(0, isString_1.default)(nestedChangeset.oldValue)) || splitType.context === "array") {
948
+ else if ((type === "String" && !(0, isString_1.default)(nestedChangeset.oldValue)) ||
949
+ splitType.context === "array") {
939
950
  // String and Arrays need special treatment:
940
951
  const arrayIterator = new arrayChangesetIterator_1.ArrayChangeSetIterator(nestedChangeset);
941
952
  const resultChangeset = {};
@@ -954,14 +965,16 @@ class ChangeSet {
954
965
  case operationTypes_1.ArrayIteratorOperationTypes.INSERT:
955
966
  // Handle inserts
956
967
  resultChangeset.remove.push([
957
- arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,
968
+ arrayIterator.opDescription.operation[0] +
969
+ arrayIterator.opDescription.offset,
958
970
  arrayIterator.opDescription.operation[1],
959
971
  ]);
960
972
  break;
961
973
  case operationTypes_1.ArrayIteratorOperationTypes.REMOVE:
962
974
  // Handle removes
963
975
  resultChangeset.insert.push([
964
- arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,
976
+ arrayIterator.opDescription.operation[0] +
977
+ arrayIterator.opDescription.offset,
965
978
  arrayIterator.opDescription.operation[1],
966
979
  ]);
967
980
  break;
@@ -969,14 +982,16 @@ class ChangeSet {
969
982
  // Handle modifies
970
983
  if (isPrimitiveType(splitType.typeid)) {
971
984
  resultChangeset.modify.push([
972
- arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,
985
+ arrayIterator.opDescription.operation[0] +
986
+ arrayIterator.opDescription.offset,
973
987
  arrayIterator.opDescription.operation[2],
974
988
  arrayIterator.opDescription.operation[1],
975
989
  ]);
976
990
  }
977
991
  else {
978
992
  resultChangeset.modify.push([
979
- arrayIterator.opDescription.operation[0] + arrayIterator.opDescription.offset,
993
+ arrayIterator.opDescription.operation[0] +
994
+ arrayIterator.opDescription.offset,
980
995
  arrayIterator.opDescription.operation[1],
981
996
  ]);
982
997
  }
@@ -1039,8 +1054,7 @@ class ChangeSet {
1039
1054
  * in a later release
1040
1055
  */
1041
1056
  toInverseChangeSet() {
1042
- if (this._changes.value !== undefined &&
1043
- this._changes.oldValue !== undefined) {
1057
+ if (this._changes.value !== undefined && this._changes.oldValue !== undefined) {
1044
1058
  const tmp = this._changes.value;
1045
1059
  this._changes.value = this._changes.oldValue;
1046
1060
  this._changes.oldValue = tmp;
@@ -1056,8 +1070,10 @@ exports.ChangeSet = ChangeSet;
1056
1070
  ChangeSet.ConflictType = changesetConflictTypes_1.ConflictType;
1057
1071
  ChangeSet.isEmptyChangeSet = isEmptyChangeset_1.isEmptyChangeSet;
1058
1072
  ChangeSet.isReservedKeyword = isReservedKeyword_1.isReservedKeyword;
1059
- ChangeSet.prototype._performApplyAfterOnPropertyArray = array_1.ChangeSetArrayFunctions._performApplyAfterOnPropertyArray;
1060
- ChangeSet.prototype._rebaseArrayChangeSetForProperty = array_1.ChangeSetArrayFunctions._rebaseArrayChangeSetForProperty;
1073
+ ChangeSet.prototype._performApplyAfterOnPropertyArray =
1074
+ array_1.ChangeSetArrayFunctions._performApplyAfterOnPropertyArray;
1075
+ ChangeSet.prototype._rebaseArrayChangeSetForProperty =
1076
+ array_1.ChangeSetArrayFunctions._rebaseArrayChangeSetForProperty;
1061
1077
  ChangeSet.prototype._rebaseChangeSetForString = array_1.ChangeSetArrayFunctions._rebaseChangeSetForString;
1062
1078
  // Add the indexed collection functions into the prototype of the ChangeSet
1063
1079
  ChangeSet.prototype._performApplyAfterOnPropertyIndexedCollection =