@fluid-experimental/property-changeset 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0

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 (205) hide show
  1. package/dist/ajvFactory.cjs +19 -0
  2. package/dist/ajvFactory.cjs.map +1 -0
  3. package/dist/ajvFactory.d.cts +7 -0
  4. package/dist/ajvFactory.d.cts.map +1 -0
  5. package/dist/changeset.d.ts +3 -6
  6. package/dist/changeset.d.ts.map +1 -1
  7. package/dist/changeset.js +75 -75
  8. package/dist/changeset.js.map +1 -1
  9. package/dist/changeset_operations/array.d.ts +6 -2
  10. package/dist/changeset_operations/array.d.ts.map +1 -1
  11. package/dist/changeset_operations/array.js +94 -96
  12. package/dist/changeset_operations/array.js.map +1 -1
  13. package/dist/changeset_operations/arrayChangesetIterator.d.ts +2 -5
  14. package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  15. package/dist/changeset_operations/arrayChangesetIterator.js +11 -12
  16. package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
  17. package/dist/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
  18. package/dist/changeset_operations/changesetConflictTypes.js +2 -2
  19. package/dist/changeset_operations/changesetConflictTypes.js.map +1 -1
  20. package/dist/changeset_operations/indexedCollection.d.ts +1 -4
  21. package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
  22. package/dist/changeset_operations/indexedCollection.js +48 -49
  23. package/dist/changeset_operations/indexedCollection.js.map +1 -1
  24. package/dist/changeset_operations/isEmptyChangeset.d.ts +1 -4
  25. package/dist/changeset_operations/isEmptyChangeset.d.ts.map +1 -1
  26. package/dist/changeset_operations/isEmptyChangeset.js +9 -9
  27. package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
  28. package/dist/helpers/typeidHelper.d.ts +0 -3
  29. package/dist/helpers/typeidHelper.d.ts.map +1 -1
  30. package/dist/helpers/typeidHelper.js +10 -10
  31. package/dist/helpers/typeidHelper.js.map +1 -1
  32. package/dist/index.d.ts +8 -8
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +19 -19
  35. package/dist/index.js.map +1 -1
  36. package/dist/isReservedKeyword.d.ts.map +1 -1
  37. package/dist/isReservedKeyword.js +2 -2
  38. package/dist/isReservedKeyword.js.map +1 -1
  39. package/dist/package.json +3 -0
  40. package/dist/pathHelper.d.ts +0 -3
  41. package/dist/pathHelper.d.ts.map +1 -1
  42. package/dist/pathHelper.js +2 -2
  43. package/dist/pathHelper.js.map +1 -1
  44. package/dist/rebase.js +8 -8
  45. package/dist/rebase.js.map +1 -1
  46. package/dist/templateSchema.d.ts.map +1 -1
  47. package/dist/templateSchema.js +2 -2
  48. package/dist/templateSchema.js.map +1 -1
  49. package/dist/templateValidator.d.ts +1 -1
  50. package/dist/templateValidator.d.ts.map +1 -1
  51. package/dist/templateValidator.js +49 -54
  52. package/dist/templateValidator.js.map +1 -1
  53. package/dist/test/array.spec.js +34 -36
  54. package/dist/test/array.spec.js.map +1 -1
  55. package/dist/test/indexedCollection.spec.js +9 -6
  56. package/dist/test/indexedCollection.spec.js.map +1 -1
  57. package/dist/test/map.spec.js +4 -4
  58. package/dist/test/map.spec.js.map +1 -1
  59. package/dist/test/pathHelper.spec.js +185 -185
  60. package/dist/test/pathHelper.spec.js.map +1 -1
  61. package/dist/test/reversibleCs.spec.js +5 -5
  62. package/dist/test/reversibleCs.spec.js.map +1 -1
  63. package/dist/test/schemaValidator.js +12 -11
  64. package/dist/test/schemaValidator.js.map +1 -1
  65. package/dist/test/schemas/badBothPropertiesAndTypeid.js +18 -18
  66. package/dist/test/schemas/badBothPropertiesAndTypeid.js.map +1 -1
  67. package/dist/test/schemas/badInvalidSemverInTypeid.js +40 -40
  68. package/dist/test/schemas/badInvalidSemverInTypeid.js.map +1 -1
  69. package/dist/test/schemas/badMissingSemverInTypeid.js +40 -40
  70. package/dist/test/schemas/badMissingSemverInTypeid.js.map +1 -1
  71. package/dist/test/schemas/badNestedProperties.js +40 -40
  72. package/dist/test/schemas/badNestedProperties.js.map +1 -1
  73. package/dist/test/schemas/badPrimitiveTypeid.js +25 -25
  74. package/dist/test/schemas/badPrimitiveTypeid.js.map +1 -1
  75. package/dist/test/schemas/badVersionedTypeid.js +41 -41
  76. package/dist/test/schemas/badVersionedTypeid.js.map +1 -1
  77. package/dist/test/schemas/goodColorPalette.js +15 -15
  78. package/dist/test/schemas/goodColorPalette.js.map +1 -1
  79. package/dist/test/schemas/goodDraftAsVersion.js +12 -12
  80. package/dist/test/schemas/goodDraftAsVersion.js.map +1 -1
  81. package/dist/test/schemas/goodPointId.js +40 -40
  82. package/dist/test/schemas/goodPointId.js.map +1 -1
  83. package/dist/test/schemas/goodReferenceAndRegular.js +16 -16
  84. package/dist/test/schemas/goodReferenceAndRegular.js.map +1 -1
  85. package/dist/test/schemas/goodReservedTypes.js +22 -22
  86. package/dist/test/schemas/goodReservedTypes.js.map +1 -1
  87. package/dist/test/schemas/goodUIBorder.js +34 -34
  88. package/dist/test/schemas/goodUIBorder.js.map +1 -1
  89. package/dist/test/schemas/index.js +55 -0
  90. package/dist/test/schemas/index.js.map +1 -0
  91. package/dist/test/tsconfig.cjs.tsbuildinfo +1 -0
  92. package/dist/test/validator/templateSyntax.spec.js +20 -25
  93. package/dist/test/validator/templateSyntax.spec.js.map +1 -1
  94. package/dist/test/validator/templateValidator.spec.js +118 -89
  95. package/dist/test/validator/templateValidator.spec.js.map +1 -1
  96. package/dist/test/validator/typeidHelper.spec.js +42 -41
  97. package/dist/test/validator/typeidHelper.spec.js.map +1 -1
  98. package/dist/utils.d.ts +17 -13
  99. package/dist/utils.d.ts.map +1 -1
  100. package/dist/utils.js +79 -79
  101. package/dist/utils.js.map +1 -1
  102. package/dist/validationResultBuilder.d.ts +2 -1
  103. package/dist/validationResultBuilder.d.ts.map +1 -1
  104. package/dist/validationResultBuilder.js.map +1 -1
  105. package/lib/ajvFactory.cjs +19 -0
  106. package/lib/ajvFactory.cjs.map +1 -0
  107. package/lib/ajvFactory.d.cts +7 -0
  108. package/lib/ajvFactory.d.cts.map +1 -0
  109. package/lib/changeset.d.ts +3 -6
  110. package/lib/changeset.d.ts.map +1 -1
  111. package/lib/changeset.js +16 -16
  112. package/lib/changeset.js.map +1 -1
  113. package/lib/changeset_operations/array.d.ts +6 -2
  114. package/lib/changeset_operations/array.d.ts.map +1 -1
  115. package/lib/changeset_operations/array.js +7 -9
  116. package/lib/changeset_operations/array.js.map +1 -1
  117. package/lib/changeset_operations/arrayChangesetIterator.d.ts +2 -5
  118. package/lib/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  119. package/lib/changeset_operations/arrayChangesetIterator.js +3 -4
  120. package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
  121. package/lib/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
  122. package/lib/changeset_operations/changesetConflictTypes.js.map +1 -1
  123. package/lib/changeset_operations/indexedCollection.d.ts +1 -4
  124. package/lib/changeset_operations/indexedCollection.d.ts.map +1 -1
  125. package/lib/changeset_operations/indexedCollection.js +10 -11
  126. package/lib/changeset_operations/indexedCollection.js.map +1 -1
  127. package/lib/changeset_operations/isEmptyChangeset.d.ts +1 -4
  128. package/lib/changeset_operations/isEmptyChangeset.d.ts.map +1 -1
  129. package/lib/changeset_operations/isEmptyChangeset.js +3 -3
  130. package/lib/changeset_operations/isEmptyChangeset.js.map +1 -1
  131. package/lib/helpers/typeidHelper.d.ts +0 -3
  132. package/lib/helpers/typeidHelper.d.ts.map +1 -1
  133. package/lib/helpers/typeidHelper.js +1 -1
  134. package/lib/helpers/typeidHelper.js.map +1 -1
  135. package/lib/index.d.ts +8 -8
  136. package/lib/index.d.ts.map +1 -1
  137. package/lib/index.js +8 -8
  138. package/lib/index.js.map +1 -1
  139. package/lib/isReservedKeyword.d.ts.map +1 -1
  140. package/lib/isReservedKeyword.js.map +1 -1
  141. package/lib/pathHelper.d.ts +0 -3
  142. package/lib/pathHelper.d.ts.map +1 -1
  143. package/lib/pathHelper.js.map +1 -1
  144. package/lib/rebase.js +2 -2
  145. package/lib/rebase.js.map +1 -1
  146. package/lib/templateSchema.d.ts.map +1 -1
  147. package/lib/templateSchema.js.map +1 -1
  148. package/lib/templateValidator.d.ts +1 -1
  149. package/lib/templateValidator.d.ts.map +1 -1
  150. package/lib/templateValidator.js +24 -29
  151. package/lib/templateValidator.js.map +1 -1
  152. package/lib/test/array.spec.js +768 -0
  153. package/lib/test/array.spec.js.map +1 -0
  154. package/lib/test/indexedCollection.spec.js +75 -0
  155. package/lib/test/indexedCollection.spec.js.map +1 -0
  156. package/lib/test/map.spec.js +17 -0
  157. package/lib/test/map.spec.js.map +1 -0
  158. package/lib/test/pathHelper.spec.js +435 -0
  159. package/lib/test/pathHelper.spec.js.map +1 -0
  160. package/lib/test/reversibleCs.spec.js +42 -0
  161. package/lib/test/reversibleCs.spec.js.map +1 -0
  162. package/lib/test/schemaValidator.js +103 -0
  163. package/lib/test/schemaValidator.js.map +1 -0
  164. package/lib/test/schemas/badBothPropertiesAndTypeid.js +24 -0
  165. package/lib/test/schemas/badBothPropertiesAndTypeid.js.map +1 -0
  166. package/lib/test/schemas/badInvalidSemverInTypeid.js +46 -0
  167. package/lib/test/schemas/badInvalidSemverInTypeid.js.map +1 -0
  168. package/lib/test/schemas/badMissingSemverInTypeid.js +46 -0
  169. package/lib/test/schemas/badMissingSemverInTypeid.js.map +1 -0
  170. package/lib/test/schemas/badNestedProperties.js +46 -0
  171. package/lib/test/schemas/badNestedProperties.js.map +1 -0
  172. package/lib/test/schemas/badPrimitiveTypeid.js +31 -0
  173. package/lib/test/schemas/badPrimitiveTypeid.js.map +1 -0
  174. package/lib/test/schemas/badVersionedTypeid.js +47 -0
  175. package/lib/test/schemas/badVersionedTypeid.js.map +1 -0
  176. package/lib/test/schemas/goodColorPalette.js +21 -0
  177. package/lib/test/schemas/goodColorPalette.js.map +1 -0
  178. package/lib/test/schemas/goodDraftAsVersion.js +18 -0
  179. package/lib/test/schemas/goodDraftAsVersion.js.map +1 -0
  180. package/lib/test/schemas/goodPointId.js +46 -0
  181. package/lib/test/schemas/goodPointId.js.map +1 -0
  182. package/lib/test/schemas/goodReferenceAndRegular.js +22 -0
  183. package/lib/test/schemas/goodReferenceAndRegular.js.map +1 -0
  184. package/lib/test/schemas/goodReservedTypes.js +29 -0
  185. package/lib/test/schemas/goodReservedTypes.js.map +1 -0
  186. package/lib/test/schemas/goodUIBorder.js +41 -0
  187. package/lib/test/schemas/goodUIBorder.js.map +1 -0
  188. package/lib/test/schemas/index.js +29 -0
  189. package/lib/test/schemas/index.js.map +1 -0
  190. package/lib/test/tsconfig.tsbuildinfo +1 -0
  191. package/lib/test/validator/templateSyntax.spec.js +83 -0
  192. package/lib/test/validator/templateSyntax.spec.js.map +1 -0
  193. package/lib/test/validator/templateValidator.spec.js +1022 -0
  194. package/lib/test/validator/templateValidator.spec.js.map +1 -0
  195. package/lib/test/validator/typeidHelper.spec.js +142 -0
  196. package/lib/test/validator/typeidHelper.spec.js.map +1 -0
  197. package/lib/utils.d.ts +17 -13
  198. package/lib/utils.d.ts.map +1 -1
  199. package/lib/utils.js +23 -23
  200. package/lib/utils.js.map +1 -1
  201. package/lib/validationResultBuilder.d.ts +2 -1
  202. package/lib/validationResultBuilder.d.ts.map +1 -1
  203. package/lib/validationResultBuilder.js.map +1 -1
  204. package/package.json +37 -16
  205. package/dist/test/tsconfig.tsbuildinfo +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;;;;AAEH,yDAAsD;AACtD,6DAAqC;AACrC,6DAAqC;AACrC,+DAAuC;AACvC,6DAAqC;AACrC,+DAAuC;AAEvC,aAAa;AACb,yEAA2E;AAE3E,0DAAuD;AACvD,8CAA2C;AAC3C,qEAAwD;AACxD,yDAAsD;AAEtD,MAAM,EAAE,uBAAuB,EAA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C,EAAE;YACvC,OAAO,OAAO,CAAC,MAAM,CAAC;SACtB;IACF,CAAC,CAAC;AACH,CAAC,EAx2BgB,mCAAmC,mDAAnC,mCAAmC,QAw2BnD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions and classes to work with ChangeSets with indexed collections (sets and maps)\n */\n\nimport { copy as cloneDeep } from \"fastest-json-copy\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isEqual from \"lodash/isEqual\";\nimport isObject from \"lodash/isObject\";\nimport without from \"lodash/without\";\nimport includes from \"lodash/includes\";\n\n// @ts-ignore\nimport { constants, joinPaths } from \"@fluid-experimental/property-common\";\nimport { ApplyChangeSetOptions, ConflictInfo, SerializedChangeSet } from \"../changeset\";\nimport { TypeIdHelper } from \"../helpers/typeidHelper\";\nimport { PathHelper } from \"../pathHelper\";\nimport { ConflictType } from \"./changesetConflictTypes\";\nimport { isEmptyChangeSet } from \"./isEmptyChangeset\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\n/**\n * @namespace property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * @alias property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * Helper functions and classes to perform operations on ChangeSets with indexed collections (sets and maps)\n */\n\n/**\n * Checks whether an object is empty (has no keys)\n * This function should be a bit faster than the isEmpty from\n * underscore. Unfortunately, at least on Chrome, it is still in\n * O(n)\n *\n * @param in_object - The object to check\n * @returns Is it empty?\n * @private\n */\nconst _fastIsEmptyObject = function (in_object: any): boolean {\n\tif (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n\t\treturn isEmpty(in_object);\n\t}\n\n\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\tfor (const _entry in in_object) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ChangeSetIndexedCollectionFunctions {\n\t/**\n\t * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n\t * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n\t * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n\t *\n\t * @param io_basePropertyChanges - The ChangeSet describing the initial state\n\t * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n\t * @param in_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_options - Optional additional parameters\n\t * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _performApplyAfterOnPropertyIndexedCollection = function (\n\t\tio_basePropertyChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: SerializedChangeSet,\n\t\tin_typeid: string,\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\t// Handle remove entry operations\n\t\tif (in_appliedPropertyChanges.remove) {\n\t\t\t// Get and initialize the corresponding entries in the existing collection\n\t\t\tlet removedEntries = in_appliedPropertyChanges.remove;\n\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.remove =\n\t\t\t\tio_basePropertyChanges.remove ||\n\t\t\t\t(Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet done = false;\n\n\t\t\tif (!Array.isArray(removedEntries)) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tremovedEntries = Object.keys(removedEntries);\n\t\t\t\t} else {\n\t\t\t\t\t// this is a reversible change set of templated types\n\t\t\t\t\tconst removedTypes = Object.keys(removedEntries);\n\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\tconst removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]] &&\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tbaseModified &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]] &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\t\tbaseRemoved.push(removedKeys[i]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (!baseRemoved[removedTypes[t]]) {\n\t\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]] = {};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]][removedKeys[i]] =\n\t\t\t\t\t\t\t\t\t\tremovedEntries[removedTypes[t]][removedKeys[i]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!done) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\n\t\t\t\t\t\t// If there is an insert for this key, we just remove it\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\tdelete baseInserted[key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tif (baseModified && baseModified[key] !== undefined) {\n\t\t\t\t\t\t\t\tdelete baseModified[key];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseRemoved[key] = in_appliedPropertyChanges.remove[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst baseInsertedTypeids = Object.keys(baseInserted);\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\t\t\t\t\t\tlet foundInTypeid;\n\n\t\t\t\t\t\t// Since we only have a flat remove list (without typeid) in the changeset, we have\n\t\t\t\t\t\t// to check all inserts\n\t\t\t\t\t\tfor (let j = 0; j < baseInsertedTypeids.length; j++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]] &&\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]][key] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tfoundInTypeid = baseInsertedTypeids[j];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (foundInTypeid) {\n\t\t\t\t\t\t\t// If this key was inserted by this ChangeSet, we just remove it from the inserted list\n\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid][key];\n\n\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t// the whole typeid from the inserted or modified section\n\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tconst baseModifiedTypeids = Object.keys(baseModified || {});\n\t\t\t\t\t\t\tfor (let j = 0; j < baseModifiedTypeids.length; j++) {\n\t\t\t\t\t\t\t\tif (baseModified[baseModifiedTypeids[j]][key]) {\n\t\t\t\t\t\t\t\t\tfoundInTypeid = baseModifiedTypeids[j];\n\t\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid][key];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Apply insert operations\n\t\tif (in_appliedPropertyChanges.insert) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n\t\t\tlet baseInserted = io_basePropertyChanges.insert;\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\n\t\t\t// Insert the inserted entries\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst insertedTypeids = isPrimitiveTypeid\n\t\t\t\t? [undefined]\n\t\t\t\t: Object.keys(in_appliedPropertyChanges.insert);\n\t\t\tfor (let i = 0; i < insertedTypeids.length; i++) {\n\t\t\t\tlet typeid = insertedTypeids[i];\n\t\t\t\tconst insertedEntries = isPrimitiveTypeid\n\t\t\t\t\t? in_appliedPropertyChanges.insert\n\t\t\t\t\t: in_appliedPropertyChanges.insert[typeid];\n\t\t\t\tconst insertedKeys = Object.keys(insertedEntries);\n\t\t\t\tlet removalCS;\n\t\t\t\tif (baseRemoved) {\n\t\t\t\t\tremovalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n\t\t\t\t}\n\t\t\t\tfor (let j = 0; j < insertedKeys.length; j++) {\n\t\t\t\t\tlet key = insertedKeys[j];\n\t\t\t\t\tlet deeplyEqualCS = false;\n\n\t\t\t\t\t// If we have a complex type in the collection, we need to do a deep comparison of the two\n\t\t\t\t\t// ChangeSets to determine, whether they are equal\n\t\t\t\t\t// TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n\t\t\t\t\t// Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n\t\t\t\t\t// the insert is reinserting exactly what was removed.\n\t\t\t\t\tif (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\tisObject(removalCS) &&\n\t\t\t\t\t\tremovalCS[key] !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Split out the two parts: all the keys other than remove/insert should match exactly.\n\t\t\t\t\t\t// The contents 'remove' and 'insert', if they exist, should also match.\n\t\t\t\t\t\tdeeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n\t\t\t\t\t\t// If there are 'insert' and 'remove', see if the removed data matches the inserted data\n\t\t\t\t\t\tif (deeplyEqualCS && insertedEntries[key].insert) {\n\t\t\t\t\t\t\tdeeplyEqualCS = isEqual(\n\t\t\t\t\t\t\t\tinsertedEntries[key].insert,\n\t\t\t\t\t\t\t\tremovalCS[key].remove,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Finally, check if the data being inserted matches the data that was removed\n\t\t\t\t\t\tconst insertedEntry = isObject(insertedEntries[key])\n\t\t\t\t\t\t\t? without(insertedEntries[key], \"insert\")\n\t\t\t\t\t\t\t: insertedEntries[key];\n\t\t\t\t\t\tconst removedEntry = isObject(removalCS[key])\n\t\t\t\t\t\t\t? without(removalCS[key], \"remove\")\n\t\t\t\t\t\t\t: removalCS[key];\n\t\t\t\t\t\tdeeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(isPrimitiveTypeid ||\n\t\t\t\t\t\t\tTypeIdHelper.isPrimitiveType(typeid) ||\n\t\t\t\t\t\t\tdeeplyEqualCS) &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\t((Array.isArray(removalCS) && includes(baseRemoved, key)) ||\n\t\t\t\t\t\t\tremovalCS[key] !== undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// A remove and insert are combined into a modify for primitive types\n\n\t\t\t\t\t\t// Remove the old remove command\n\t\t\t\t\t\tlet oldValueMatches = false;\n\t\t\t\t\t\tif (Array.isArray(removalCS)) {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove = without(\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.remove,\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid] = without(\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid],\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toldValueMatches =\n\t\t\t\t\t\t\t\tdeeplyEqualCS || removalCS[key] === insertedEntries[key];\n\t\t\t\t\t\t\tdelete removalCS[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Insert a modify command instead\n\t\t\t\t\t\tif (!oldValueMatches) {\n\t\t\t\t\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[key] = insertedEntries[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] =\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] || {};\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid][key] = cloneDeep(\n\t\t\t\t\t\t\t\t\tinsertedEntries[key],\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n\t\t\t\t\t\tbaseInserted[key] = insertedEntries[key];\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\t(!baseInserted[typeid] || baseInserted[typeid][key] === undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\tbaseInserted[typeid] = baseInserted[typeid] || {};\n\t\t\t\t\t\tbaseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle modification operations\n\t\tif (in_appliedPropertyChanges.modify) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tconst modifiedEntries = in_appliedPropertyChanges.modify;\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\n\t\t\t// Process the modifications\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n\t\t\tfor (let i = 0; i < modifiedTypeids.length; i++) {\n\t\t\t\tlet typeid = modifiedTypeids[i];\n\n\t\t\t\tconst modifyKeys = Object.keys(\n\t\t\t\t\tisPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid],\n\t\t\t\t);\n\t\t\t\tfor (let j = 0; j < modifyKeys.length; j++) {\n\t\t\t\t\tlet key = modifyKeys[j];\n\n\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\tlet newValue = modifiedEntries[key];\n\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\tnewValue = newValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tbaseInserted[key] = newValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\tbaseModified[key].value = newValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseModified[key] = newValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If this is a polymorphic collection, we can still have individual entries with\n\t\t\t\t\t\t// primitive types\n\t\t\t\t\t\tconst isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n\t\t\t\t\t\tif (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\tlet newValue = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\tnewValue = modifiedEntries[typeid][key].value;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// In the case of Int64 or Uint64 we copy the array so that\n\t\t\t\t\t\t\t\t// both ChangeSets don't point to the same instance\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tnewValue = newValue.slice();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] &&\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].hasOwnProperty(\"value\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].value = newValue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] = newValue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tbaseModified[typeid] &&\n\t\t\t\t\t\t\tbaseModified[typeid][key] !== undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// If there was a previous modification operation, we have to merge the two\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\t// Primitive types can simply be overwritten, however we have an exception for\n\t\t\t\t\t\t\t\t// 64 bit integers (until javascript natively supports them)\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tlet appliedVal = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\t\tif (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\t\tappliedVal = appliedVal.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = appliedVal.slice();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseModified[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbaseModified[typeid] = baseModified[typeid] || {};\n\t\t\t\t\t\t\tbaseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Performs the rebase operation for set and map collections.\n\t *\n\t * @param in_ownPropertyChangeSet - The ChangeSet for this collection.\n\t * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased.\n\t * @param in_basePath - Base path to get to the property processed by this function.\n\t * @param in_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_useSquareBracketsInPath - If set to true, paths will be created using the angular brackets syntax (for\n\t * arrays), otherwise dots will be used (for NodeProperties).\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict.\n\t * @param in_options - Optional additional parameters.\n\t * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _rebaseIndexedCollectionChangeSetForProperty = function (\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_basePath: string,\n\t\tin_typeid: string,\n\t\tin_useSquareBracketsInPath: boolean,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\tconst changesByKeys = {};\n\t\tlet modifyMap = {};\n\t\t// Helper function which stores the changes indexed by key in the changesByKeys array to\n\t\t// make it easier to compare the related changes in the two ChangeSets\n\t\tconst addChanges = function (\n\t\t\tin_collection: Record<string, any>,\n\t\t\tin_changeIdentifier: string,\n\t\t\tin_changePrefix: string,\n\t\t\tin_typeidChange?: string,\n\t\t) {\n\t\t\t// Collection didn't exist in this ChangeSet\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n\t\t\t// distinguish the two cases here\n\t\t\tconst keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n\t\t\t// Add all entries indexed with the key\n\t\t\tfor (let j = 0; j < keys.length; j++) {\n\t\t\t\tconst key = keys[j];\n\n\t\t\t\t// Store the type of the change\n\t\t\t\tchangesByKeys[key] = changesByKeys[key] || {};\n\t\t\t\tchangesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix]\n\t\t\t\t\t? `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}`\n\t\t\t\t\t: in_changeIdentifier;\n\n\t\t\t\t// If applicable store the typeid of the change\n\t\t\t\tif (in_typeidChange) {\n\t\t\t\t\tchangesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n\t\t\t\t}\n\n\t\t\t\t// Store the ChangeSet\n\t\t\t\tif (in_changePrefix === \"other\") {\n\t\t\t\t\tchangesByKeys[key].change = Array.isArray(in_collection)\n\t\t\t\t\t\t? key\n\t\t\t\t\t\t: in_collection[key];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n\t\tconst addChangesWithTypeids = function (\n\t\t\tin_collection,\n\t\t\tin_changeIdentifier,\n\t\t\tin_changePrefix,\n\t\t) {\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Iterate over the typeids (or use dummy entry for the iteration\n\t\t\tconst addedKeyTypeids = Object.keys(in_collection);\n\t\t\tfor (let i = 0; i < addedKeyTypeids.length; i++) {\n\t\t\t\tconst Typeid = addedKeyTypeids[i];\n\t\t\t\taddChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n\t\t\t}\n\t\t};\n\n\t\t// Insert all changes from the ChangeSet into the lookup map\n\t\tif (Array.isArray(in_ownPropertyChangeSet.remove)) {\n\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t}\n\t\t}\n\n\t\tif (isPrimitiveTypeid) {\n\t\t\taddChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t} else {\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t}\n\n\t\t// Check for modifications that affect the same object\n\t\tconst changedKeys = Object.keys(changesByKeys);\n\t\tfor (let i = 0; i < changedKeys.length; i++) {\n\t\t\tconst key = changedKeys[i];\n\t\t\tconst newPath = in_useSquareBracketsInPath\n\t\t\t\t? `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]`\n\t\t\t\t: joinPaths(\n\t\t\t\t\t\tin_basePath,\n\t\t\t\t\t\tPathHelper.quotePathSegmentIfNeeded(key),\n\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t );\n\n\t\t\tconst modification = changesByKeys[key];\n\t\t\tif (modification.own && modification.other) {\n\t\t\t\t/*\n We found a key that was changed by both ChangeSets at the same time\n We now have to handle the conflicting changes. The changes we do, are summarized in this table:\n\n <START REBASE HANDLING TABLE>\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | \\Own| insert | modify | remove | remove+insert |\n | \\ | | | | |\n |other\\ | | | | |\n +=======+=================+==================+===================+=====================================+\n | | conflicting | incompatible | incompatible | incompatible |\n |insert | inserts | psets | psets | psets |\n | | | | | |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | merge recursively| conflict | conflict |\n |modify | psets | (conflicting on | | (modify can not be applied due to |\n | | | leaf) | - delete modify | to incompatible base) |\n | | | | in other | |\n | | | | | - delete modify in other |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | incompatible |\n |remove | psets | change | change | psets |\n | | | | | |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | conflict |\n |remove+| psets | change | change | |\n |insert | | | | - remove conflicting insert |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n <END REBASE HANDLING TABLE>\n */\n\n\t\t\t\t// A key was modified after it had been removed\n\t\t\t\tif (modification.own === \"modify\" && modification.other === \"modify\") {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisPrimitiveTypeid ||\n\t\t\t\t\t\t(TypeIdHelper.isPrimitiveType(modification.ownTypeid) &&\n\t\t\t\t\t\t\tmodification.ownTypeid !== \"String\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We have two modification operations that affect the same entry for a base type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflict\n\t\t\t\t\t\tlet ownModify = in_ownPropertyChangeSet.modify;\n\t\t\t\t\t\tlet rebasedModify = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\townModify = ownModify[modification.otherTypeid];\n\t\t\t\t\t\t\trebasedModify = rebasedModify[modification.otherTypeid];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: ownModify[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t\t// If value is the same, delete the entry\n\t\t\t\t\t\tlet ownValue = ownModify[key];\n\t\t\t\t\t\tif (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\townValue = ownValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet rebaseValue = rebasedModify[key];\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof rebaseValue === \"object\" &&\n\t\t\t\t\t\t\trebaseValue.hasOwnProperty(\"value\")\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\trebaseValue = rebaseValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Int64\" ||\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Uint64\" ||\n\t\t\t\t\t\t\townValue.length === 2\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// For (u)int64, values are arrays of 2 elements\n\t\t\t\t\t\t\tif (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (ownValue === rebaseValue) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rebaseChangeSetForPropertyEntryWithTypeid(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tin_ownPropertyChangeSet.modify[modification.ownTypeid],\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid],\n\t\t\t\t\t\t\tmodification.ownTypeid,\n\t\t\t\t\t\t\tnewPath,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"remove\" && modification.other === \"modify\") {\n\t\t\t\t\tmodifyMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.modify[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.modify;\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\tdelete modifyMap[key];\n\t\t\t\t} else if (\n\t\t\t\t\tmodification.own === \"remove_insert\" &&\n\t\t\t\t\tmodification.other === \"modify\"\n\t\t\t\t) {\n\t\t\t\t\tif (!isPrimitiveTypeid) {\n\t\t\t\t\t\t// We have a conflicting change. A node was removed and inserted (replaced) in the original\n\t\t\t\t\t\t// ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n\t\t\t\t\t\t// can have been changed significantly by this operation, we don't know whether we can\n\t\t\t\t\t\t// apply the modification\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n\t\t\t\t\t\t\tconflictingChange:\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.modify[modification.otherTypeid][key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\t(modification.own === \"modify\" || modification.own === \"remove\") &&\n\t\t\t\t\t(modification.other === \"remove\" || modification.other === \"remove_insert\")\n\t\t\t\t) {\n\t\t\t\t\tif (modification.own === \"modify\") {\n\t\t\t\t\t\tmodifyMap = modification.ownTypeid\n\t\t\t\t\t\t\t? in_ownPropertyChangeSet.modify[modification.ownTypeid]\n\t\t\t\t\t\t\t: in_ownPropertyChangeSet.modify;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.REMOVE_AFTER_MODIFY,\n\t\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have a duplicated delete, we remove it from the new ChangeSet\n\t\t\t\t\tif (modification.own === \"remove\") {\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[modification.otherTypeid][\n\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"insert\" && modification.other === \"insert\") {\n\t\t\t\t\tif (isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(modification.ownTypeid)) {\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// We have two insert operations that affect the same key for a primitive type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflicting set\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Convert to modify\n\t\t\t\t\t\tlet oldValue;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodifyMap[key] = { value: insertMap[key], oldValue };\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n\t\t\t\t\t\t// just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tmodification.own === \"remove_insert\" &&\n\t\t\t\t\tmodification.other === \"remove_insert\"\n\t\t\t\t) {\n\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t// Raise the duplicate inserts as a conflict\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t} else {\n\t\t\t\t\t// All other operations are conflicting changes, which only occur for ChangeSets that are relative\n\t\t\t\t\t// to different bases\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.INVALID_CHANGESET_BASE,\n\t\t\t\t\t\tconflictingChange: modification.change,\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Remove the change from the ChangeSet\n\t\t\t\t\tif (modification.other !== \"remove\") {\n\t\t\t\t\t\tif (modification.otherTypeid !== undefined) {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][\n\t\t\t\t\t\t\t\tmodification.otherTypeid\n\t\t\t\t\t\t\t][key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove remove operations from the ChangeSet\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other] = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other],\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Removes empty entries from the .children collection of the ChangeSet\n\t *\n\t * @param in_propertyChanges - The ChangeSet to clean up\n\t * @param in_containsTypeids - Does this ChangeSet contain typeids\n\t * @private\n\t */\n\texport const _cleanIndexedCollectionChangeSet = function (\n\t\tin_propertyChanges: SerializedChangeSet,\n\t\tin_containsTypeids: boolean,\n\t) {\n\t\tconst changes = in_propertyChanges;\n\t\t// Clean inserts\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.insert || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n\t\t\t\t\tdelete changes.insert[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove add group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.insert)) {\n\t\t\tdelete changes.insert;\n\t\t}\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.remove || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n\t\t\t\t\tdelete changes.remove[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Remove remove group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.remove)) {\n\t\t\tdelete changes.remove;\n\t\t}\n\n\t\t// Clean modifies\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.modify || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tconst modifies = changes.modify[typeidList[j]];\n\t\t\t\tconst modifyKeys = Object.keys(modifies);\n\t\t\t\tfor (let k = 0; k < modifyKeys.length; k++) {\n\t\t\t\t\tif (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n\t\t\t\t\t\tdelete modifies[modifyKeys[k]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n\t\t\t\t\tdelete changes.modify[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove modify group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.modify)) {\n\t\t\tdelete changes.modify;\n\t\t}\n\t};\n}\n"]}
1
+ {"version":3,"file":"indexedCollection.js","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AAC,CAAC,CAAC,CAAC,CAAC;qBAC/B;iBACD;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;oBACtD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBACrC;aACD;SACD;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACvC,OAAO,OAAO,CAAC,MAAM,CAAC;SACtB;IACF,CAAC,CAAC;AACH,CAAC,EAx2BgB,mCAAmC,mDAAnC,mCAAmC,QAw2BnD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions and classes to work with ChangeSets with indexed collections (sets and maps)\n */\n\nimport { constants, joinPaths } from \"@fluid-experimental/property-common\";\nimport { copy as cloneDeep } from \"fastest-json-copy\";\nimport includes from \"lodash/includes.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport isObject from \"lodash/isObject.js\";\nimport without from \"lodash/without.js\";\n\n// @ts-ignore\nimport { ApplyChangeSetOptions, ConflictInfo, SerializedChangeSet } from \"../changeset.js\";\nimport { TypeIdHelper } from \"../helpers/typeidHelper.js\";\nimport { PathHelper } from \"../pathHelper.js\";\n\nimport { ConflictType } from \"./changesetConflictTypes.js\";\nimport { isEmptyChangeSet } from \"./isEmptyChangeset.js\";\n\nconst { PROPERTY_PATH_DELIMITER, MSG } = constants;\n\n/**\n * @namespace property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * @alias property-changeset.ChangeSetOperations.IndexedCollectionOperations\n * Helper functions and classes to perform operations on ChangeSets with indexed collections (sets and maps)\n */\n\n/**\n * Checks whether an object is empty (has no keys)\n * This function should be a bit faster than the isEmpty from\n * underscore. Unfortunately, at least on Chrome, it is still in\n * O(n)\n *\n * @param in_object - The object to check\n * @returns Is it empty?\n * @private\n */\nconst _fastIsEmptyObject = function (in_object: any): boolean {\n\tif (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n\t\treturn isEmpty(in_object);\n\t}\n\n\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\tfor (const _entry in in_object) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ChangeSetIndexedCollectionFunctions {\n\t/**\n\t * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n\t * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n\t * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n\t *\n\t * @param io_basePropertyChanges - The ChangeSet describing the initial state\n\t * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n\t * @param in_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_options - Optional additional parameters\n\t * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _performApplyAfterOnPropertyIndexedCollection = function (\n\t\tio_basePropertyChanges: SerializedChangeSet,\n\t\tin_appliedPropertyChanges: SerializedChangeSet,\n\t\tin_typeid: string,\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\t// Handle remove entry operations\n\t\tif (in_appliedPropertyChanges.remove) {\n\t\t\t// Get and initialize the corresponding entries in the existing collection\n\t\t\tlet removedEntries = in_appliedPropertyChanges.remove;\n\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.remove =\n\t\t\t\tio_basePropertyChanges.remove ||\n\t\t\t\t(Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet done = false;\n\n\t\t\tif (!Array.isArray(removedEntries)) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tremovedEntries = Object.keys(removedEntries);\n\t\t\t\t} else {\n\t\t\t\t\t// this is a reversible change set of templated types\n\t\t\t\t\tconst removedTypes = Object.keys(removedEntries);\n\t\t\t\t\tfor (let t = 0; t < removedTypes.length; t++) {\n\t\t\t\t\t\tconst removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n\t\t\t\t\t\tfor (let i = 0; i < removedKeys.length; i++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]] &&\n\t\t\t\t\t\t\t\tbaseInserted[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\tdelete baseInserted[removedTypes[t]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tbaseModified &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]] &&\n\t\t\t\t\t\t\t\t\tbaseModified[removedTypes[t]][removedKeys[i]] !== undefined\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]][removedKeys[i]];\n\n\t\t\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t\t\t// the whole typeid from the inserted section\n\t\t\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n\t\t\t\t\t\t\t\t\t\tdelete baseModified[removedTypes[t]];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\t\tbaseRemoved.push(removedKeys[i]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (!baseRemoved[removedTypes[t]]) {\n\t\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]] = {};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseRemoved[removedTypes[t]][removedKeys[i]] =\n\t\t\t\t\t\t\t\t\t\tremovedEntries[removedTypes[t]][removedKeys[i]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdone = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!done) {\n\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\n\t\t\t\t\t\t// If there is an insert for this key, we just remove it\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\tdelete baseInserted[key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tif (baseModified && baseModified[key] !== undefined) {\n\t\t\t\t\t\t\t\tdelete baseModified[key];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tif (Array.isArray(baseRemoved)) {\n\t\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseRemoved[key] = in_appliedPropertyChanges.remove[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst baseInsertedTypeids = Object.keys(baseInserted);\n\t\t\t\t\tfor (let i = 0; i < removedEntries.length; i++) {\n\t\t\t\t\t\tlet key = removedEntries[i];\n\t\t\t\t\t\tlet foundInTypeid;\n\n\t\t\t\t\t\t// Since we only have a flat remove list (without typeid) in the changeset, we have\n\t\t\t\t\t\t// to check all inserts\n\t\t\t\t\t\tfor (let j = 0; j < baseInsertedTypeids.length; j++) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]] &&\n\t\t\t\t\t\t\t\tbaseInserted[baseInsertedTypeids[j]][key] !== undefined\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tfoundInTypeid = baseInsertedTypeids[j];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (foundInTypeid) {\n\t\t\t\t\t\t\t// If this key was inserted by this ChangeSet, we just remove it from the inserted list\n\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid][key];\n\n\t\t\t\t\t\t\t// If all entries for a typeid have been removed, we can remove\n\t\t\t\t\t\t\t// the whole typeid from the inserted or modified section\n\t\t\t\t\t\t\tif (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseInserted[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (baseModified && isEmpty(baseModified[foundInTypeid])) {\n\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// There could be a modify entry for this key, which we have to remove\n\t\t\t\t\t\t\tconst baseModifiedTypeids = Object.keys(baseModified || {});\n\t\t\t\t\t\t\tfor (let j = 0; j < baseModifiedTypeids.length; j++) {\n\t\t\t\t\t\t\t\tif (baseModified[baseModifiedTypeids[j]][key]) {\n\t\t\t\t\t\t\t\t\tfoundInTypeid = baseModifiedTypeids[j];\n\t\t\t\t\t\t\t\t\tdelete baseModified[foundInTypeid][key];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Otherwise we add it to the remove list\n\t\t\t\t\t\t\tbaseRemoved.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Apply insert operations\n\t\tif (in_appliedPropertyChanges.insert) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n\t\t\tlet baseInserted = io_basePropertyChanges.insert;\n\t\t\tlet baseRemoved = io_basePropertyChanges.remove;\n\n\t\t\t// Insert the inserted entries\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst insertedTypeids = isPrimitiveTypeid\n\t\t\t\t? [undefined]\n\t\t\t\t: Object.keys(in_appliedPropertyChanges.insert);\n\t\t\tfor (let i = 0; i < insertedTypeids.length; i++) {\n\t\t\t\tlet typeid = insertedTypeids[i];\n\t\t\t\tconst insertedEntries = isPrimitiveTypeid\n\t\t\t\t\t? in_appliedPropertyChanges.insert\n\t\t\t\t\t: in_appliedPropertyChanges.insert[typeid];\n\t\t\t\tconst insertedKeys = Object.keys(insertedEntries);\n\t\t\t\tlet removalCS;\n\t\t\t\tif (baseRemoved) {\n\t\t\t\t\tremovalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n\t\t\t\t}\n\t\t\t\tfor (let j = 0; j < insertedKeys.length; j++) {\n\t\t\t\t\tlet key = insertedKeys[j];\n\t\t\t\t\tlet deeplyEqualCS = false;\n\n\t\t\t\t\t// If we have a complex type in the collection, we need to do a deep comparison of the two\n\t\t\t\t\t// ChangeSets to determine, whether they are equal\n\t\t\t\t\t// TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n\t\t\t\t\t// Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n\t\t\t\t\t// the insert is reinserting exactly what was removed.\n\t\t\t\t\tif (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\tisObject(removalCS) &&\n\t\t\t\t\t\tremovalCS[key] !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Split out the two parts: all the keys other than remove/insert should match exactly.\n\t\t\t\t\t\t// The contents 'remove' and 'insert', if they exist, should also match.\n\t\t\t\t\t\tdeeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n\t\t\t\t\t\t// If there are 'insert' and 'remove', see if the removed data matches the inserted data\n\t\t\t\t\t\tif (deeplyEqualCS && insertedEntries[key].insert) {\n\t\t\t\t\t\t\tdeeplyEqualCS = isEqual(\n\t\t\t\t\t\t\t\tinsertedEntries[key].insert,\n\t\t\t\t\t\t\t\tremovalCS[key].remove,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Finally, check if the data being inserted matches the data that was removed\n\t\t\t\t\t\tconst insertedEntry = isObject(insertedEntries[key])\n\t\t\t\t\t\t\t? without(insertedEntries[key], \"insert\")\n\t\t\t\t\t\t\t: insertedEntries[key];\n\t\t\t\t\t\tconst removedEntry = isObject(removalCS[key])\n\t\t\t\t\t\t\t? without(removalCS[key], \"remove\")\n\t\t\t\t\t\t\t: removalCS[key];\n\t\t\t\t\t\tdeeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(isPrimitiveTypeid ||\n\t\t\t\t\t\t\tTypeIdHelper.isPrimitiveType(typeid) ||\n\t\t\t\t\t\t\tdeeplyEqualCS) &&\n\t\t\t\t\t\tremovalCS &&\n\t\t\t\t\t\t((Array.isArray(removalCS) && includes(baseRemoved, key)) ||\n\t\t\t\t\t\t\tremovalCS[key] !== undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// A remove and insert are combined into a modify for primitive types\n\n\t\t\t\t\t\t// Remove the old remove command\n\t\t\t\t\t\tlet oldValueMatches = false;\n\t\t\t\t\t\tif (Array.isArray(removalCS)) {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove = without(\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.remove,\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid] = without(\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.remove[typeid],\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toldValueMatches =\n\t\t\t\t\t\t\t\tdeeplyEqualCS || removalCS[key] === insertedEntries[key];\n\t\t\t\t\t\t\tdelete removalCS[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Insert a modify command instead\n\t\t\t\t\t\tif (!oldValueMatches) {\n\t\t\t\t\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[key] = insertedEntries[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] =\n\t\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid] || {};\n\t\t\t\t\t\t\t\tio_basePropertyChanges.modify[typeid][key] = cloneDeep(\n\t\t\t\t\t\t\t\t\tinsertedEntries[key],\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n\t\t\t\t\t\tbaseInserted[key] = insertedEntries[key];\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t!isPrimitiveTypeid &&\n\t\t\t\t\t\t(!baseInserted[typeid] || baseInserted[typeid][key] === undefined)\n\t\t\t\t\t) {\n\t\t\t\t\t\tbaseInserted[typeid] = baseInserted[typeid] || {};\n\t\t\t\t\t\tbaseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle modification operations\n\t\tif (in_appliedPropertyChanges.modify) {\n\t\t\t// Get and initialize the corresponding entries from the existing collection\n\t\t\tconst modifiedEntries = in_appliedPropertyChanges.modify;\n\t\t\tio_basePropertyChanges = io_basePropertyChanges || {};\n\t\t\tio_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n\t\t\tlet baseModified = io_basePropertyChanges.modify;\n\t\t\tlet baseInserted = io_basePropertyChanges.insert || {};\n\n\t\t\t// Process the modifications\n\n\t\t\t// If no typeids are included, we just use a placeholder for the iteration below\n\t\t\tconst modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n\t\t\tfor (let i = 0; i < modifiedTypeids.length; i++) {\n\t\t\t\tlet typeid = modifiedTypeids[i];\n\n\t\t\t\tconst modifyKeys = Object.keys(\n\t\t\t\t\tisPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid],\n\t\t\t\t);\n\t\t\t\tfor (let j = 0; j < modifyKeys.length; j++) {\n\t\t\t\t\tlet key = modifyKeys[j];\n\n\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\tlet newValue = modifiedEntries[key];\n\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\tnewValue = newValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (baseInserted[key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tbaseInserted[key] = newValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\tbaseModified[key].value = newValue;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbaseModified[key] = newValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If this is a polymorphic collection, we can still have individual entries with\n\t\t\t\t\t\t// primitive types\n\t\t\t\t\t\tconst isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n\t\t\t\t\t\tif (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n\t\t\t\t\t\t\t// If this entry was added by this ChangeSet, we modify the insert operation according to the\n\t\t\t\t\t\t\t// new ChangeSet\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\tlet newValue = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\tif (newValue && newValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\tnewValue = modifiedEntries[typeid][key].value;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// In the case of Int64 or Uint64 we copy the array so that\n\t\t\t\t\t\t\t\t// both ChangeSets don't point to the same instance\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tnewValue = newValue.slice();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] &&\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].hasOwnProperty(\"value\")\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key].value = newValue;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid][key] = newValue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseInserted[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tbaseModified[typeid] &&\n\t\t\t\t\t\t\tbaseModified[typeid][key] !== undefined\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// If there was a previous modification operation, we have to merge the two\n\t\t\t\t\t\t\tif (isEntryPrimitiveType && typeid !== \"String\") {\n\t\t\t\t\t\t\t\t// Primitive types can simply be overwritten, however we have an exception for\n\t\t\t\t\t\t\t\t// 64 bit integers (until javascript natively supports them)\n\t\t\t\t\t\t\t\tif (typeid === \"Int64\" || typeid === \"Uint64\") {\n\t\t\t\t\t\t\t\t\tlet appliedVal = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\t\tif (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\t\t\t\tappliedVal = appliedVal.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = appliedVal.slice();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbaseModified[typeid][key] = modifiedEntries[typeid][key];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.performApplyAfterOnPropertyWithTypeid(\n\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\tbaseModified[typeid],\n\t\t\t\t\t\t\t\t\tmodifiedEntries[typeid],\n\t\t\t\t\t\t\t\t\ttypeid,\n\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbaseModified[typeid] = baseModified[typeid] || {};\n\t\t\t\t\t\t\tbaseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Performs the rebase operation for set and map collections.\n\t *\n\t * @param in_ownPropertyChangeSet - The ChangeSet for this collection.\n\t * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased.\n\t * @param in_basePath - Base path to get to the property processed by this function.\n\t * @param in_typeid - The typeid of the contents collection (without the collection type).\n\t * @param in_useSquareBracketsInPath - If set to true, paths will be created using the angular brackets syntax (for\n\t * arrays), otherwise dots will be used (for NodeProperties).\n\t * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict.\n\t * @param in_options - Optional additional parameters.\n\t * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n\t * more compact changeset during the apply operation.\n\t *\n\t * @private\n\t */\n\texport const _rebaseIndexedCollectionChangeSetForProperty = function (\n\t\tin_ownPropertyChangeSet: SerializedChangeSet,\n\t\tio_rebasePropertyChangeSet: SerializedChangeSet,\n\t\tin_basePath: string,\n\t\tin_typeid: string,\n\t\tin_useSquareBracketsInPath: boolean,\n\t\tout_conflicts: ConflictInfo[],\n\t\tin_options: ApplyChangeSetOptions,\n\t) {\n\t\tconst isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n\t\tconst changesByKeys = {};\n\t\tlet modifyMap = {};\n\t\t// Helper function which stores the changes indexed by key in the changesByKeys array to\n\t\t// make it easier to compare the related changes in the two ChangeSets\n\t\tconst addChanges = function (\n\t\t\tin_collection: Record<string, any>,\n\t\t\tin_changeIdentifier: string,\n\t\t\tin_changePrefix: string,\n\t\t\tin_typeidChange?: string,\n\t\t) {\n\t\t\t// Collection didn't exist in this ChangeSet\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n\t\t\t// distinguish the two cases here\n\t\t\tconst keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n\t\t\t// Add all entries indexed with the key\n\t\t\tfor (let j = 0; j < keys.length; j++) {\n\t\t\t\tconst key = keys[j];\n\n\t\t\t\t// Store the type of the change\n\t\t\t\tchangesByKeys[key] = changesByKeys[key] || {};\n\t\t\t\tchangesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix]\n\t\t\t\t\t? `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}`\n\t\t\t\t\t: in_changeIdentifier;\n\n\t\t\t\t// If applicable store the typeid of the change\n\t\t\t\tif (in_typeidChange) {\n\t\t\t\t\tchangesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n\t\t\t\t}\n\n\t\t\t\t// Store the ChangeSet\n\t\t\t\tif (in_changePrefix === \"other\") {\n\t\t\t\t\tchangesByKeys[key].change = Array.isArray(in_collection)\n\t\t\t\t\t\t? key\n\t\t\t\t\t\t: in_collection[key];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n\t\tconst addChangesWithTypeids = function (\n\t\t\tin_collection,\n\t\t\tin_changeIdentifier,\n\t\t\tin_changePrefix,\n\t\t) {\n\t\t\tif (in_collection === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Iterate over the typeids (or use dummy entry for the iteration\n\t\t\tconst addedKeyTypeids = Object.keys(in_collection);\n\t\t\tfor (let i = 0; i < addedKeyTypeids.length; i++) {\n\t\t\t\tconst Typeid = addedKeyTypeids[i];\n\t\t\t\taddChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n\t\t\t}\n\t\t};\n\n\t\t// Insert all changes from the ChangeSet into the lookup map\n\t\tif (Array.isArray(in_ownPropertyChangeSet.remove)) {\n\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t} else {\n\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\taddChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t} else {\n\t\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n\t\t\t}\n\t\t}\n\n\t\tif (isPrimitiveTypeid) {\n\t\t\taddChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t} else {\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n\t\t\taddChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n\t\t\taddChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n\t\t}\n\n\t\t// Check for modifications that affect the same object\n\t\tconst changedKeys = Object.keys(changesByKeys);\n\t\tfor (let i = 0; i < changedKeys.length; i++) {\n\t\t\tconst key = changedKeys[i];\n\t\t\tconst newPath = in_useSquareBracketsInPath\n\t\t\t\t? `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]`\n\t\t\t\t: joinPaths(\n\t\t\t\t\t\tin_basePath,\n\t\t\t\t\t\tPathHelper.quotePathSegmentIfNeeded(key),\n\t\t\t\t\t\tPROPERTY_PATH_DELIMITER,\n\t\t\t\t );\n\n\t\t\tconst modification = changesByKeys[key];\n\t\t\tif (modification.own && modification.other) {\n\t\t\t\t/*\n We found a key that was changed by both ChangeSets at the same time\n We now have to handle the conflicting changes. The changes we do, are summarized in this table:\n\n <START REBASE HANDLING TABLE>\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | \\Own| insert | modify | remove | remove+insert |\n | \\ | | | | |\n |other\\ | | | | |\n +=======+=================+==================+===================+=====================================+\n | | conflicting | incompatible | incompatible | incompatible |\n |insert | inserts | psets | psets | psets |\n | | | | | |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | merge recursively| conflict | conflict |\n |modify | psets | (conflicting on | | (modify can not be applied due to |\n | | | leaf) | - delete modify | to incompatible base) |\n | | | | in other | |\n | | | | | - delete modify in other |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | incompatible |\n |remove | psets | change | change | psets |\n | | | | | |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n | | incompatible | non-conflicting | non-conflicting | conflict |\n |remove+| psets | change | change | |\n |insert | | | | - remove conflicting insert |\n | | | | - rem dupl. remove| |\n +-------+-----------------+------------------+-------------------+-------------------------------------+\n <END REBASE HANDLING TABLE>\n */\n\n\t\t\t\t// A key was modified after it had been removed\n\t\t\t\tif (modification.own === \"modify\" && modification.other === \"modify\") {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisPrimitiveTypeid ||\n\t\t\t\t\t\t(TypeIdHelper.isPrimitiveType(modification.ownTypeid) &&\n\t\t\t\t\t\t\tmodification.ownTypeid !== \"String\")\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We have two modification operations that affect the same entry for a base type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflict\n\t\t\t\t\t\tlet ownModify = in_ownPropertyChangeSet.modify;\n\t\t\t\t\t\tlet rebasedModify = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\townModify = ownModify[modification.otherTypeid];\n\t\t\t\t\t\t\trebasedModify = rebasedModify[modification.otherTypeid];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: ownModify[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t\t// If value is the same, delete the entry\n\t\t\t\t\t\tlet ownValue = ownModify[key];\n\t\t\t\t\t\tif (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n\t\t\t\t\t\t\townValue = ownValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet rebaseValue = rebasedModify[key];\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof rebaseValue === \"object\" &&\n\t\t\t\t\t\t\trebaseValue.hasOwnProperty(\"value\")\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\trebaseValue = rebaseValue.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Int64\" ||\n\t\t\t\t\t\t\tmodification.ownTypeid === \"Uint64\" ||\n\t\t\t\t\t\t\townValue.length === 2\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// For (u)int64, values are arrays of 2 elements\n\t\t\t\t\t\t\tif (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (ownValue === rebaseValue) {\n\t\t\t\t\t\t\t\tdelete rebasedModify[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rebaseChangeSetForPropertyEntryWithTypeid(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tin_ownPropertyChangeSet.modify[modification.ownTypeid],\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid],\n\t\t\t\t\t\t\tmodification.ownTypeid,\n\t\t\t\t\t\t\tnewPath,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tout_conflicts,\n\t\t\t\t\t\t\tin_options,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"remove\" && modification.other === \"modify\") {\n\t\t\t\t\tmodifyMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.modify[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.modify;\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\tdelete modifyMap[key];\n\t\t\t\t} else if (\n\t\t\t\t\tmodification.own === \"remove_insert\" &&\n\t\t\t\t\tmodification.other === \"modify\"\n\t\t\t\t) {\n\t\t\t\t\tif (!isPrimitiveTypeid) {\n\t\t\t\t\t\t// We have a conflicting change. A node was removed and inserted (replaced) in the original\n\t\t\t\t\t\t// ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n\t\t\t\t\t\t// can have been changed significantly by this operation, we don't know whether we can\n\t\t\t\t\t\t// apply the modification\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n\t\t\t\t\t\t\tconflictingChange:\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.modify[modification.otherTypeid][key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\t(modification.own === \"modify\" || modification.own === \"remove\") &&\n\t\t\t\t\t(modification.other === \"remove\" || modification.other === \"remove_insert\")\n\t\t\t\t) {\n\t\t\t\t\tif (modification.own === \"modify\") {\n\t\t\t\t\t\tmodifyMap = modification.ownTypeid\n\t\t\t\t\t\t\t? in_ownPropertyChangeSet.modify[modification.ownTypeid]\n\t\t\t\t\t\t\t: in_ownPropertyChangeSet.modify;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.REMOVE_AFTER_MODIFY,\n\t\t\t\t\t\t\tconflictingChange: modifyMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have a duplicated delete, we remove it from the new ChangeSet\n\t\t\t\t\tif (modification.own === \"remove\") {\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.remove,\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (isPrimitiveTypeid) {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[key];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet.remove[modification.otherTypeid][\n\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (modification.own === \"insert\" && modification.other === \"insert\") {\n\t\t\t\t\tif (isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(modification.ownTypeid)) {\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// We have two insert operations that affect the same key for a primitive type.\n\t\t\t\t\t\t// This is a legal operation, the second one will overwrite the first one, but we\n\t\t\t\t\t\t// report it as a possible conflicting set\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Convert to modify\n\t\t\t\t\t\tlet oldValue;\n\t\t\t\t\t\tif (modification.otherTypeid) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify =\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet.modify || {};\n\t\t\t\t\t\t\tmodifyMap = io_rebasePropertyChangeSet.modify;\n\t\t\t\t\t\t\toldValue = in_ownPropertyChangeSet.insert[key];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodifyMap[key] = { value: insertMap[key], oldValue };\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n\t\t\t\t\t\t// just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n\t\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t\t// Create the conflict information\n\t\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\t\ttype: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n\t\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t\t};\n\t\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t\t// Delete the modification from the rebased ChangeSet\n\t\t\t\t\t\tdelete insertMap[key];\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\tmodification.own === \"remove_insert\" &&\n\t\t\t\t\tmodification.other === \"remove_insert\"\n\t\t\t\t) {\n\t\t\t\t\tlet insertMap = modification.otherTypeid\n\t\t\t\t\t\t? io_rebasePropertyChangeSet.insert[modification.otherTypeid]\n\t\t\t\t\t\t: io_rebasePropertyChangeSet.insert;\n\n\t\t\t\t\t// Raise the duplicate inserts as a conflict\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.COLLIDING_SET,\n\t\t\t\t\t\tconflictingChange: insertMap[key],\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\t\t\t\t} else {\n\t\t\t\t\t// All other operations are conflicting changes, which only occur for ChangeSets that are relative\n\t\t\t\t\t// to different bases\n\n\t\t\t\t\t// Create the conflict information\n\t\t\t\t\tlet conflict = {\n\t\t\t\t\t\tpath: newPath,\n\t\t\t\t\t\ttype: ConflictType.INVALID_CHANGESET_BASE,\n\t\t\t\t\t\tconflictingChange: modification.change,\n\t\t\t\t\t};\n\t\t\t\t\tout_conflicts.push(conflict);\n\n\t\t\t\t\t// Remove the change from the ChangeSet\n\t\t\t\t\tif (modification.other !== \"remove\") {\n\t\t\t\t\t\tif (modification.otherTypeid !== undefined) {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][\n\t\t\t\t\t\t\t\tmodification.otherTypeid\n\t\t\t\t\t\t\t][key];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Remove remove operations from the ChangeSet\n\t\t\t\t\t\tif (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other] = without(\n\t\t\t\t\t\t\t\tio_rebasePropertyChangeSet[modification.other],\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdelete io_rebasePropertyChangeSet[modification.other][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove unnecessary entries from the ChangeSet\n\t\tthis._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n\t};\n\n\t/**\n\t * Removes empty entries from the .children collection of the ChangeSet\n\t *\n\t * @param in_propertyChanges - The ChangeSet to clean up\n\t * @param in_containsTypeids - Does this ChangeSet contain typeids\n\t * @private\n\t */\n\texport const _cleanIndexedCollectionChangeSet = function (\n\t\tin_propertyChanges: SerializedChangeSet,\n\t\tin_containsTypeids: boolean,\n\t) {\n\t\tconst changes = in_propertyChanges;\n\t\t// Clean inserts\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.insert || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n\t\t\t\t\tdelete changes.insert[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove add group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.insert)) {\n\t\t\tdelete changes.insert;\n\t\t}\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.remove || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tif (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n\t\t\t\t\tdelete changes.remove[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Remove remove group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.remove)) {\n\t\t\tdelete changes.remove;\n\t\t}\n\n\t\t// Clean modifies\n\n\t\t// First remove unused typeid sections\n\t\tif (in_containsTypeids) {\n\t\t\tlet typeidList = Object.keys(changes.modify || {});\n\t\t\tfor (let j = 0; j < typeidList.length; j++) {\n\t\t\t\tconst modifies = changes.modify[typeidList[j]];\n\t\t\t\tconst modifyKeys = Object.keys(modifies);\n\t\t\t\tfor (let k = 0; k < modifyKeys.length; k++) {\n\t\t\t\t\tif (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n\t\t\t\t\t\tdelete modifies[modifyKeys[k]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n\t\t\t\t\tdelete changes.modify[typeidList[j]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove modify group if no operations are present\n\t\tif (_fastIsEmptyObject(changes.modify)) {\n\t\t\tdelete changes.modify;\n\t\t}\n\t};\n}\n"]}
@@ -2,10 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- /**
6
- * @fileoverview Helper function to check whether a changeset is empty
7
- */
8
- import { SerializedChangeSet } from "../changeset";
5
+ import { SerializedChangeSet } from "../changeset.js";
9
6
  /**
10
7
  * Helper function which checks whether a given serialized changeSet is an empty changeSet.
11
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"isEmptyChangeset.d.ts","sourceRoot":"","sources":["../../src/changeset_operations/isEmptyChangeset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAMH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,iBAAkB,mBAAmB,KAAG,OAIO,CAAC"}
1
+ {"version":3,"file":"isEmptyChangeset.d.ts","sourceRoot":"","sources":["../../src/changeset_operations/isEmptyChangeset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,iBAAkB,mBAAmB,KAAG,OAIO,CAAC"}
@@ -3,17 +3,17 @@
3
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
- /**
7
- * @fileoverview Helper function to check whether a changeset is empty
8
- */
9
6
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
8
  };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
10
  exports.isEmptyChangeSet = void 0;
14
- const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
15
- const has_1 = __importDefault(require("lodash/has"));
16
- const isObject_1 = __importDefault(require("lodash/isObject"));
11
+ /**
12
+ * @fileoverview Helper function to check whether a changeset is empty
13
+ */
14
+ const has_js_1 = __importDefault(require("lodash/has.js"));
15
+ const isEmpty_js_1 = __importDefault(require("lodash/isEmpty.js"));
16
+ const isObject_js_1 = __importDefault(require("lodash/isObject.js"));
17
17
  /**
18
18
  * Helper function which checks whether a given serialized changeSet is an empty changeSet.
19
19
  *
@@ -21,8 +21,8 @@ const isObject_1 = __importDefault(require("lodash/isObject"));
21
21
  * @returns True if it is an empty changeset.
22
22
  */
23
23
  const isEmptyChangeSet = (in_changeSet) => in_changeSet === undefined ||
24
- ((0, isObject_1.default)(in_changeSet) &&
25
- ((0, isEmpty_1.default)(in_changeSet) ||
26
- (Object.keys(in_changeSet).length === 1 && (0, has_1.default)(in_changeSet, "typeid"))));
24
+ ((0, isObject_js_1.default)(in_changeSet) &&
25
+ ((0, isEmpty_js_1.default)(in_changeSet) ||
26
+ (Object.keys(in_changeSet).length === 1 && (0, has_js_1.default)(in_changeSet, "typeid"))));
27
27
  exports.isEmptyChangeSet = isEmptyChangeSet;
28
28
  //# sourceMappingURL=isEmptyChangeset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isEmptyChangeset.js","sourceRoot":"","sources":["../../src/changeset_operations/isEmptyChangeset.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;;;;AAEH,6DAAqC;AACrC,qDAA6B;AAC7B,+DAAuC;AAIvC;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,YAAiC,EAAW,EAAE,CAC9E,YAAY,KAAK,SAAS;IAC1B,CAAC,IAAA,kBAAQ,EAAC,YAAY,CAAC;QACtB,CAAC,IAAA,iBAAO,EAAC,YAAY,CAAC;YACrB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,aAAG,EAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAJhE,QAAA,gBAAgB,oBAIgD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper function to check whether a changeset is empty\n */\n\nimport isEmpty from \"lodash/isEmpty\";\nimport has from \"lodash/has\";\nimport isObject from \"lodash/isObject\";\n\nimport { SerializedChangeSet } from \"../changeset\";\n\n/**\n * Helper function which checks whether a given serialized changeSet is an empty changeSet.\n *\n * @param in_changeSet - The changeset to test\n * @returns True if it is an empty changeset.\n */\nexport const isEmptyChangeSet = (in_changeSet: SerializedChangeSet): boolean =>\n\tin_changeSet === undefined ||\n\t(isObject(in_changeSet) &&\n\t\t(isEmpty(in_changeSet) ||\n\t\t\t(Object.keys(in_changeSet).length === 1 && has(in_changeSet, \"typeid\"))));\n"]}
1
+ {"version":3,"file":"isEmptyChangeset.js","sourceRoot":"","sources":["../../src/changeset_operations/isEmptyChangeset.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;GAEG;AAEH,2DAAgC;AAChC,mEAAwC;AACxC,qEAA0C;AAI1C;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,YAAiC,EAAW,EAAE,CAC9E,YAAY,KAAK,SAAS;IAC1B,CAAC,IAAA,qBAAQ,EAAC,YAAY,CAAC;QACtB,CAAC,IAAA,oBAAO,EAAC,YAAY,CAAC;YACrB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,gBAAG,EAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAJhE,QAAA,gBAAgB,oBAIgD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper function to check whether a changeset is empty\n */\n\nimport has from \"lodash/has.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isObject from \"lodash/isObject.js\";\n\nimport { SerializedChangeSet } from \"../changeset.js\";\n\n/**\n * Helper function which checks whether a given serialized changeSet is an empty changeSet.\n *\n * @param in_changeSet - The changeset to test\n * @returns True if it is an empty changeset.\n */\nexport const isEmptyChangeSet = (in_changeSet: SerializedChangeSet): boolean =>\n\tin_changeSet === undefined ||\n\t(isObject(in_changeSet) &&\n\t\t(isEmpty(in_changeSet) ||\n\t\t\t(Object.keys(in_changeSet).length === 1 && has(in_changeSet, \"typeid\"))));\n"]}
@@ -2,9 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- /**
6
- * @fileoverview Helper functions to work with typeid strings
7
- */
8
5
  export declare interface ExtractedVersion {
9
6
  version: string;
10
7
  typeidWithoutVersion: string;
@@ -1 +1 @@
1
- {"version":3,"file":"typeidHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/typeidHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAQH,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,gBAAgB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AAEH,yBAAiB,YAAY,CAAC;IAC7B;;;;;;OAMG;IACH,SAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAY1D;IAED;;;;;;OAMG;IACH,SAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,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
3
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
4
  * Licensed under the MIT License.
5
5
  */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.TypeIdHelper = void 0;
6
8
  /**
7
9
  * @fileoverview Helper functions to work with typeid strings
8
10
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.TypeIdHelper = void 0;
11
11
  // @ts-ignore
12
12
  const property_common_1 = require("@fluid-experimental/property-common");
13
- const templateSchema_1 = require("../templateSchema");
13
+ const templateSchema_js_1 = require("../templateSchema.js");
14
14
  const { MSG } = property_common_1.constants;
15
15
  /**
16
16
  * Helper for Type IDs
@@ -28,7 +28,7 @@ var TypeIdHelper;
28
28
  * @internal
29
29
  */
30
30
  function isPrimitiveType(in_typeid) {
31
- const primitiveTypes = templateSchema_1.TemplateSchema["$defs"]["primitive-typeid"]["enum"];
31
+ const primitiveTypes = templateSchema_js_1.TemplateSchema["$defs"]["primitive-typeid"]["enum"];
32
32
  if (in_typeid === undefined || in_typeid === "") {
33
33
  return false;
34
34
  }
@@ -56,7 +56,7 @@ var TypeIdHelper;
56
56
  * @internal
57
57
  */
58
58
  function isReservedType(in_typeid) {
59
- const reservedTypes = templateSchema_1.TemplateSchema["$defs"]["reserved-typeid"]["enum"];
59
+ const reservedTypes = templateSchema_js_1.TemplateSchema["$defs"]["reserved-typeid"]["enum"];
60
60
  return reservedTypes.indexOf(in_typeid) >= 0;
61
61
  }
62
62
  TypeIdHelper.isReservedType = isReservedType;
@@ -229,10 +229,10 @@ var TypeIdHelper;
229
229
  if (in_baseTypeid.substr(0, 10) === "Reference<") {
230
230
  in_baseTypeid = "Reference";
231
231
  }
232
- if (!templateSchema_1.NativeTypes[in_typeid]) {
232
+ if (!templateSchema_js_1.NativeTypes[in_typeid]) {
233
233
  throw new Error(MSG.TYPEID_NOT_NATIVE + in_typeid);
234
234
  }
235
- if (!templateSchema_1.NativeTypes[in_baseTypeid]) {
235
+ if (!templateSchema_js_1.NativeTypes[in_baseTypeid]) {
236
236
  throw new Error(MSG.TYPEID_NOT_NATIVE + in_baseTypeid);
237
237
  }
238
238
  if (in_baseTypeid === "BaseProperty" || in_typeid === in_baseTypeid) {
@@ -241,7 +241,7 @@ var TypeIdHelper;
241
241
  if (in_typeid === "BaseProperty") {
242
242
  return false;
243
243
  }
244
- let parents = templateSchema_1.NativeTypes[in_typeid]["inherits"];
244
+ let parents = templateSchema_js_1.NativeTypes[in_typeid]["inherits"];
245
245
  // recursively call the function for the parent of the typeid
246
246
  for (let i = 0; i < parents.length; i++) {
247
247
  if (this.nativeInheritsFrom(parents[i], in_baseTypeid)) {
@@ -258,7 +258,7 @@ var TypeIdHelper;
258
258
  * @internal
259
259
  */
260
260
  function getPrimitiveTypeIds() {
261
- return templateSchema_1.TemplateSchema["$defs"]["primitive-typeid"]["enum"];
261
+ return templateSchema_js_1.TemplateSchema["$defs"]["primitive-typeid"]["enum"];
262
262
  }
263
263
  TypeIdHelper.getPrimitiveTypeIds = getPrimitiveTypeIds;
264
264
  /**
@@ -268,7 +268,7 @@ var TypeIdHelper;
268
268
  * @internal
269
269
  */
270
270
  function getReservedTypeIds() {
271
- return templateSchema_1.TemplateSchema["$defs"]["reserved-typeid"]["enum"];
271
+ return templateSchema_js_1.TemplateSchema["$defs"]["reserved-typeid"]["enum"];
272
272
  }
273
273
  TypeIdHelper.getReservedTypeIds = getReservedTypeIds;
274
274
  })(TypeIdHelper || (exports.TypeIdHelper = TypeIdHelper = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"typeidHelper.js","sourceRoot":"","sources":["../../src/helpers/typeidHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;AAEH,aAAa;AACb,yEAAgE;AAChE,sDAAsF;AAEtF,MAAM,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAgB1B;;;;GAIG;AACH,2DAA2D;AAC3D,IAAiB,YAAY,CA6Q5B;AA7QD,WAAiB,YAAY;IAC5B;;;;;;OAMG;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,EAAE;YACjC,OAAO,KAAK,CAAC;SACb;QAED,IAAI,OAAO,GAAG,4BAAW,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;QAEjD,6DAA6D;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAI,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE;gBACvD,OAAO,IAAI,CAAC;aACZ;SACD;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAtCe,+BAAkB,qBAsCjC,CAAA;IAED;;;;;OAKG;IACH,SAAgB,mBAAmB;QAClC,OAAO,+BAAkB,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;IAFe,gCAAmB,sBAElC,CAAA;IAED;;;;;OAKG;IACH,SAAgB,kBAAkB;QACjC,OAAO,+BAAkB,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;IAFe,+BAAkB,qBAEjC,CAAA;AACF,CAAC,EA7QgB,YAAY,4BAAZ,YAAY,QA6Q5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions to work with typeid strings\n */\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\nimport { TemplateSchema as templateSchemaJson, NativeTypes } from \"../templateSchema\";\n\nconst { MSG } = constants;\n\nexport declare interface ExtractedVersion {\n\tversion: string;\n\ttypeidWithoutVersion: string;\n}\n\n/**\n * @internal\n */\nexport declare interface ExtractedContext {\n\ttypeid: string;\n\tcontext: string;\n\tisEnum: boolean;\n}\n\n/**\n * Helper for Type IDs\n * @description Helper functions to work with typeid strings\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace TypeIdHelper {\n\t/**\n\t * Checks whether the given type is a primitive type.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a base type?\n\t * @internal\n\t */\n\texport function isPrimitiveType(in_typeid: string): boolean {\n\t\tconst primitiveTypes = templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n\n\t\tif (in_typeid === undefined || in_typeid === \"\") {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tin_typeid.substr(0, 5) === \"enum<\" ||\n\t\t\tin_typeid.substr(0, 10) === \"Reference<\" ||\n\t\t\tprimitiveTypes.indexOf(in_typeid) >= 0\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether the given type is a template typeid.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a base template typeid?\n\t * @internal\n\t */\n\texport function isTemplateTypeid(in_typeid: string): boolean {\n\t\treturn in_typeid.indexOf(\":\") !== -1;\n\t}\n\n\t/**\n\t * Checks whether the given type is a reserved type.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a reserved type?\n\t * @internal\n\t */\n\texport function isReservedType(in_typeid: string): boolean {\n\t\tconst reservedTypes = templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n\t\treturn reservedTypes.indexOf(in_typeid) >= 0;\n\t}\n\n\t/**\n\t * Extract the version number from the given typeid\n\t * @param in_typeid - The typeid to check against\n\t * @returns Extracted version\n\t * @internal\n\t */\n\texport function extractVersion(in_typeid): ExtractedVersion {\n\t\tif (!in_typeid) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_DEFINED);\n\t\t}\n\t\tconst splitTypeId = in_typeid.split(\"-\");\n\n\t\treturn {\n\t\t\tversion: splitTypeId[1],\n\t\t\ttypeidWithoutVersion: splitTypeId[0],\n\t\t};\n\t}\n\n\t/**\n\t * Extracts the context from a typeid\n\t *\n\t * @param in_typeid - The typeid to process\n\t * @returns The typeid without context, the context and if we have an enum type\n\t * @internal\n\t */\n\texport function extractContext(in_typeid: string | undefined): ExtractedContext {\n\t\tconst bracketIndex = in_typeid.indexOf(\"<\");\n\t\tif (bracketIndex !== -1 && in_typeid.endsWith(\">\")) {\n\t\t\tlet typeid = in_typeid.substr(bracketIndex + 1, in_typeid.length - bracketIndex - 2);\n\t\t\tlet context = in_typeid.substr(0, bracketIndex);\n\n\t\t\t// Special case to handle collections without a typeid (e.g. \"map<>\", which should\n\t\t\t// be able to support all property types\n\t\t\tif (typeid === \"\") {\n\t\t\t\ttypeid = context !== \"set\" ? \"BaseProperty\" : \"NamedProperty\";\n\t\t\t}\n\n\t\t\t// Special case to handle enums (e.g. array<enum<myType>>)\n\t\t\tlet isEnum = false;\n\t\t\tif (context === \"enum\" || typeid.substr(0, 5) === \"enum<\") {\n\t\t\t\tisEnum = true;\n\t\t\t\tif (context === \"enum\") {\n\t\t\t\t\tcontext = \"single\";\n\t\t\t\t} else {\n\t\t\t\t\t// remove the `enum<...>` tag to get the raw typeid\n\t\t\t\t\ttypeid = typeid.substr(5, typeid.length - 6);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (context === \"Reference\") {\n\t\t\t\ttypeid = `Reference<${typeid}>`;\n\t\t\t\tcontext = \"single\";\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttypeid,\n\t\t\t\tcontext,\n\t\t\t\tisEnum,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttypeid: in_typeid,\n\t\t\t\tcontext: \"single\",\n\t\t\t\tisEnum: false,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Creates a collection typeid string from the\n\t * typeid and the context.\n\t *\n\t * @param in_typeid - The typeid in the collection\n\t * @param in_context - The context\n\t * @param in_enum - Set to true if the type should get an enum tag\n\t *\n\t * @returns The combined typeid string\n\t * @internal\n\t */\n\texport function createSerializationTypeId(\n\t\tin_typeid: string,\n\t\tin_context: string,\n\t\tin_enum: boolean,\n\t): string {\n\t\t// in_enum\n\t\tif (in_typeid === \"BaseProperty\") {\n\t\t\t// Special case for BaseProperties. These get represented as a collection\n\t\t\t// typeid without a child typeid. E.g. map<> instead of map<BaseProperty>\n\t\t\treturn `${in_context}<>`;\n\t\t} else {\n\t\t\tif (in_enum) {\n\t\t\t\treturn in_context === \"\" || in_context === \"single\"\n\t\t\t\t\t? `enum<${in_typeid}>`\n\t\t\t\t\t: `${in_context}<enum<${in_typeid}>>`;\n\t\t\t} else {\n\t\t\t\treturn `${in_context}<${in_typeid}>`;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks, whether the supplied typeid is a reference property type id\n\t *\n\t * @param in_typeid - The typeid to check\n\t * @returns Is this a reference property typeid?\n\t * @internal\n\t */\n\texport function isReferenceTypeId(in_typeid: string | undefined): boolean {\n\t\t// in_enum\n\t\treturn (\n\t\t\tin_typeid === \"Reference\" ||\n\t\t\t(in_typeid.substr(0, 10) === \"Reference<\" && in_typeid.substr(-1) === \">\")\n\t\t);\n\t}\n\n\t/**\n\t * Returns the type of the properties a reference points to\n\t *\n\t * @param in_typeid - The typeid to process\n\t * @return The type of the referenced property\n\t * @internal\n\t */\n\texport function extractReferenceTargetTypeIdFromReference(in_typeid: string): string {\n\t\t// in_enum\n\t\treturn in_typeid.substr(0, 10) === \"Reference<\"\n\t\t\t? in_typeid.substr(10, in_typeid.length - 11)\n\t\t\t: \"BaseProperty\";\n\t}\n\n\t/**\n\t * Checks whether the given type is a template typeid.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a base template typeid?\n\t * @internal\n\t */\n\texport function isSchemaTypeid(in_typeid: string): boolean {\n\t\treturn typeof in_typeid === \"string\" && in_typeid.indexOf(\":\") !== -1;\n\t}\n\n\t/**\n\t * Extracts referenced typeid from input typeid\n\t *\n\t * @param in_typeid - typeid\n\t *\n\t * @return referenced typeid or in_param if it is not a reference\n\t * @internal\n\t */\n\texport function extractTypeId(in_typeid): string {\n\t\tconst matches = in_typeid.match(/\\<(.*?)\\>/);\n\t\treturn matches !== null && matches.length > 0\n\t\t\t? matches[0].replace(/[\\<\\>]/gi, \"\")\n\t\t\t: in_typeid;\n\t}\n\n\t/**\n\t * Check wether the in_typeid inherits from the in_baseTypeid.\n\t *\n\t * @remarks Note: By default, this also returns true if in_typeid === in_baseTypeid.\n\t *\n\t * @param in_typeid - Typeid for which we want to check, whethwe in_baseTypeid is a parent.\n\t * @param in_baseTypeid - The base typeId to check for.\n\t * @throws If in_typeid or in_baseTypeid are not native typeid.\n\t * @returns True if in_baseTypeid is a parent of in_typeid.\n\t * @internal\n\t */\n\texport function nativeInheritsFrom(in_typeid: string, in_baseTypeid: string): boolean {\n\t\tif (!in_typeid || !in_baseTypeid) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_DEFINED);\n\t\t}\n\n\t\tif (in_typeid.substr(0, 10) === \"Reference<\") {\n\t\t\tin_typeid = \"Reference\";\n\t\t}\n\n\t\tif (in_baseTypeid.substr(0, 10) === \"Reference<\") {\n\t\t\tin_baseTypeid = \"Reference\";\n\t\t}\n\n\t\tif (!NativeTypes[in_typeid]) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_NATIVE + in_typeid);\n\t\t}\n\n\t\tif (!NativeTypes[in_baseTypeid]) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_NATIVE + in_baseTypeid);\n\t\t}\n\n\t\tif (in_baseTypeid === \"BaseProperty\" || in_typeid === in_baseTypeid) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (in_typeid === \"BaseProperty\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet parents = NativeTypes[in_typeid][\"inherits\"];\n\n\t\t// recursively call the function for the parent of the typeid\n\t\tfor (let i = 0; i < parents.length; i++) {\n\t\t\tif (this.nativeInheritsFrom(parents[i], in_baseTypeid)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * return all primitive typeIds\n\t *\n\t * @returns return a list of primitiveTypeIds\n\t * @internal\n\t */\n\texport function getPrimitiveTypeIds(): string[] {\n\t\treturn templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n\t}\n\n\t/**\n\t * return all reserved typeIds\n\t *\n\t * @returns return a list of reservedTypeIds\n\t * @internal\n\t */\n\texport function getReservedTypeIds(): string[] {\n\t\treturn templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n\t}\n}\n"]}
1
+ {"version":3,"file":"typeidHelper.js","sourceRoot":"","sources":["../../src/helpers/typeidHelper.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,aAAa;AACb,yEAAgE;AAEhE,4DAAyF;AAEzF,MAAM,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAgB1B;;;;GAIG;AACH,2DAA2D;AAC3D,IAAiB,YAAY,CA6Q5B;AA7QD,WAAiB,YAAY;IAC5B;;;;;;OAMG;IACH,SAAgB,eAAe,CAAC,SAAiB;QAChD,MAAM,cAAc,GAAG,kCAAkB,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;QAE/E,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE,EAAE;YAChD,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CACN,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO;YAClC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,YAAY;YACxC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CACtC,CAAC;IACH,CAAC;IAZe,4BAAe,kBAY9B,CAAA;IAED;;;;;;OAMG;IACH,SAAgB,gBAAgB,CAAC,SAAiB;QACjD,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,CAAC;IAFe,6BAAgB,mBAE/B,CAAA;IAED;;;;;;OAMG;IACH,SAAgB,cAAc,CAAC,SAAiB;QAC/C,MAA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;IAC/D,CAAC;IAFe,+BAAkB,qBAEjC,CAAA;AACF,CAAC,EA7QgB,YAAY,4BAAZ,YAAY,QA6Q5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper functions to work with typeid strings\n */\n\n// @ts-ignore\nimport { constants } from \"@fluid-experimental/property-common\";\n\nimport { NativeTypes, TemplateSchema as templateSchemaJson } from \"../templateSchema.js\";\n\nconst { MSG } = constants;\n\nexport declare interface ExtractedVersion {\n\tversion: string;\n\ttypeidWithoutVersion: string;\n}\n\n/**\n * @internal\n */\nexport declare interface ExtractedContext {\n\ttypeid: string;\n\tcontext: string;\n\tisEnum: boolean;\n}\n\n/**\n * Helper for Type IDs\n * @description Helper functions to work with typeid strings\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace TypeIdHelper {\n\t/**\n\t * Checks whether the given type is a primitive type.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a base type?\n\t * @internal\n\t */\n\texport function isPrimitiveType(in_typeid: string): boolean {\n\t\tconst primitiveTypes = templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n\n\t\tif (in_typeid === undefined || in_typeid === \"\") {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tin_typeid.substr(0, 5) === \"enum<\" ||\n\t\t\tin_typeid.substr(0, 10) === \"Reference<\" ||\n\t\t\tprimitiveTypes.indexOf(in_typeid) >= 0\n\t\t);\n\t}\n\n\t/**\n\t * Checks whether the given type is a template typeid.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a base template typeid?\n\t * @internal\n\t */\n\texport function isTemplateTypeid(in_typeid: string): boolean {\n\t\treturn in_typeid.indexOf(\":\") !== -1;\n\t}\n\n\t/**\n\t * Checks whether the given type is a reserved type.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a reserved type?\n\t * @internal\n\t */\n\texport function isReservedType(in_typeid: string): boolean {\n\t\tconst reservedTypes = templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n\t\treturn reservedTypes.indexOf(in_typeid) >= 0;\n\t}\n\n\t/**\n\t * Extract the version number from the given typeid\n\t * @param in_typeid - The typeid to check against\n\t * @returns Extracted version\n\t * @internal\n\t */\n\texport function extractVersion(in_typeid): ExtractedVersion {\n\t\tif (!in_typeid) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_DEFINED);\n\t\t}\n\t\tconst splitTypeId = in_typeid.split(\"-\");\n\n\t\treturn {\n\t\t\tversion: splitTypeId[1],\n\t\t\ttypeidWithoutVersion: splitTypeId[0],\n\t\t};\n\t}\n\n\t/**\n\t * Extracts the context from a typeid\n\t *\n\t * @param in_typeid - The typeid to process\n\t * @returns The typeid without context, the context and if we have an enum type\n\t * @internal\n\t */\n\texport function extractContext(in_typeid: string | undefined): ExtractedContext {\n\t\tconst bracketIndex = in_typeid.indexOf(\"<\");\n\t\tif (bracketIndex !== -1 && in_typeid.endsWith(\">\")) {\n\t\t\tlet typeid = in_typeid.substr(bracketIndex + 1, in_typeid.length - bracketIndex - 2);\n\t\t\tlet context = in_typeid.substr(0, bracketIndex);\n\n\t\t\t// Special case to handle collections without a typeid (e.g. \"map<>\", which should\n\t\t\t// be able to support all property types\n\t\t\tif (typeid === \"\") {\n\t\t\t\ttypeid = context !== \"set\" ? \"BaseProperty\" : \"NamedProperty\";\n\t\t\t}\n\n\t\t\t// Special case to handle enums (e.g. array<enum<myType>>)\n\t\t\tlet isEnum = false;\n\t\t\tif (context === \"enum\" || typeid.substr(0, 5) === \"enum<\") {\n\t\t\t\tisEnum = true;\n\t\t\t\tif (context === \"enum\") {\n\t\t\t\t\tcontext = \"single\";\n\t\t\t\t} else {\n\t\t\t\t\t// remove the `enum<...>` tag to get the raw typeid\n\t\t\t\t\ttypeid = typeid.substr(5, typeid.length - 6);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (context === \"Reference\") {\n\t\t\t\ttypeid = `Reference<${typeid}>`;\n\t\t\t\tcontext = \"single\";\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttypeid,\n\t\t\t\tcontext,\n\t\t\t\tisEnum,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttypeid: in_typeid,\n\t\t\t\tcontext: \"single\",\n\t\t\t\tisEnum: false,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Creates a collection typeid string from the\n\t * typeid and the context.\n\t *\n\t * @param in_typeid - The typeid in the collection\n\t * @param in_context - The context\n\t * @param in_enum - Set to true if the type should get an enum tag\n\t *\n\t * @returns The combined typeid string\n\t * @internal\n\t */\n\texport function createSerializationTypeId(\n\t\tin_typeid: string,\n\t\tin_context: string,\n\t\tin_enum: boolean,\n\t): string {\n\t\t// in_enum\n\t\tif (in_typeid === \"BaseProperty\") {\n\t\t\t// Special case for BaseProperties. These get represented as a collection\n\t\t\t// typeid without a child typeid. E.g. map<> instead of map<BaseProperty>\n\t\t\treturn `${in_context}<>`;\n\t\t} else {\n\t\t\tif (in_enum) {\n\t\t\t\treturn in_context === \"\" || in_context === \"single\"\n\t\t\t\t\t? `enum<${in_typeid}>`\n\t\t\t\t\t: `${in_context}<enum<${in_typeid}>>`;\n\t\t\t} else {\n\t\t\t\treturn `${in_context}<${in_typeid}>`;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks, whether the supplied typeid is a reference property type id\n\t *\n\t * @param in_typeid - The typeid to check\n\t * @returns Is this a reference property typeid?\n\t * @internal\n\t */\n\texport function isReferenceTypeId(in_typeid: string | undefined): boolean {\n\t\t// in_enum\n\t\treturn (\n\t\t\tin_typeid === \"Reference\" ||\n\t\t\t(in_typeid.substr(0, 10) === \"Reference<\" && in_typeid.substr(-1) === \">\")\n\t\t);\n\t}\n\n\t/**\n\t * Returns the type of the properties a reference points to\n\t *\n\t * @param in_typeid - The typeid to process\n\t * @return The type of the referenced property\n\t * @internal\n\t */\n\texport function extractReferenceTargetTypeIdFromReference(in_typeid: string): string {\n\t\t// in_enum\n\t\treturn in_typeid.substr(0, 10) === \"Reference<\"\n\t\t\t? in_typeid.substr(10, in_typeid.length - 11)\n\t\t\t: \"BaseProperty\";\n\t}\n\n\t/**\n\t * Checks whether the given type is a template typeid.\n\t *\n\t * @param in_typeid - The typeid we want to check\n\t * @returns Is this a base template typeid?\n\t * @internal\n\t */\n\texport function isSchemaTypeid(in_typeid: string): boolean {\n\t\treturn typeof in_typeid === \"string\" && in_typeid.indexOf(\":\") !== -1;\n\t}\n\n\t/**\n\t * Extracts referenced typeid from input typeid\n\t *\n\t * @param in_typeid - typeid\n\t *\n\t * @return referenced typeid or in_param if it is not a reference\n\t * @internal\n\t */\n\texport function extractTypeId(in_typeid): string {\n\t\tconst matches = in_typeid.match(/\\<(.*?)\\>/);\n\t\treturn matches !== null && matches.length > 0\n\t\t\t? matches[0].replace(/[\\<\\>]/gi, \"\")\n\t\t\t: in_typeid;\n\t}\n\n\t/**\n\t * Check wether the in_typeid inherits from the in_baseTypeid.\n\t *\n\t * @remarks Note: By default, this also returns true if in_typeid === in_baseTypeid.\n\t *\n\t * @param in_typeid - Typeid for which we want to check, whethwe in_baseTypeid is a parent.\n\t * @param in_baseTypeid - The base typeId to check for.\n\t * @throws If in_typeid or in_baseTypeid are not native typeid.\n\t * @returns True if in_baseTypeid is a parent of in_typeid.\n\t * @internal\n\t */\n\texport function nativeInheritsFrom(in_typeid: string, in_baseTypeid: string): boolean {\n\t\tif (!in_typeid || !in_baseTypeid) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_DEFINED);\n\t\t}\n\n\t\tif (in_typeid.substr(0, 10) === \"Reference<\") {\n\t\t\tin_typeid = \"Reference\";\n\t\t}\n\n\t\tif (in_baseTypeid.substr(0, 10) === \"Reference<\") {\n\t\t\tin_baseTypeid = \"Reference\";\n\t\t}\n\n\t\tif (!NativeTypes[in_typeid]) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_NATIVE + in_typeid);\n\t\t}\n\n\t\tif (!NativeTypes[in_baseTypeid]) {\n\t\t\tthrow new Error(MSG.TYPEID_NOT_NATIVE + in_baseTypeid);\n\t\t}\n\n\t\tif (in_baseTypeid === \"BaseProperty\" || in_typeid === in_baseTypeid) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (in_typeid === \"BaseProperty\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet parents = NativeTypes[in_typeid][\"inherits\"];\n\n\t\t// recursively call the function for the parent of the typeid\n\t\tfor (let i = 0; i < parents.length; i++) {\n\t\t\tif (this.nativeInheritsFrom(parents[i], in_baseTypeid)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * return all primitive typeIds\n\t *\n\t * @returns return a list of primitiveTypeIds\n\t * @internal\n\t */\n\texport function getPrimitiveTypeIds(): string[] {\n\t\treturn templateSchemaJson[\"$defs\"][\"primitive-typeid\"][\"enum\"];\n\t}\n\n\t/**\n\t * return all reserved typeIds\n\t *\n\t * @returns return a list of reservedTypeIds\n\t * @internal\n\t */\n\texport function getReservedTypeIds(): string[] {\n\t\treturn templateSchemaJson[\"$defs\"][\"reserved-typeid\"][\"enum\"];\n\t}\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,14 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ChangeSet, SerializedChangeSet } from "./changeset";
6
- import { ArrayChangeSetIterator } from "./changeset_operations/arrayChangesetIterator";
7
- import { ExtractedContext, TypeIdHelper } from "./helpers/typeidHelper";
8
- import { PathHelper } from "./pathHelper";
9
- import { rebaseToRemoteChanges } from "./rebase";
10
- import { TemplateSchema } from "./templateSchema";
11
- import { TemplateValidator } from "./templateValidator";
12
- import { Utils } from "./utils";
5
+ import { ChangeSet, SerializedChangeSet } from "./changeset.js";
6
+ import { ArrayChangeSetIterator } from "./changeset_operations/arrayChangesetIterator.js";
7
+ import { ExtractedContext, TypeIdHelper } from "./helpers/typeidHelper.js";
8
+ import { PathHelper } from "./pathHelper.js";
9
+ import { rebaseToRemoteChanges } from "./rebase.js";
10
+ import { TemplateSchema } from "./templateSchema.js";
11
+ import { TemplateValidator } from "./templateValidator.js";
12
+ import { Utils } from "./utils.js";
13
13
  /**
14
14
  * @internal
15
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;GAEG;AACH,QAAA,MAAQ,gBAAgB,+BAAU,CAAC;AAEnC,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,KAAK,EACL,UAAU,EACV,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GAChB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAA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