@fluid-experimental/property-changeset 1.3.5 → 1.3.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"indexedCollection.d.ts","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAWH,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAqCxF,yBAAiB,mCAAmC,CAAC;IACjD;;;;;;;;;;;;;;OAcG;IACI,MAAM,6CAA6C,2BAC9B,mBAAmB,6BAChB,mBAAmB,aACnC,MAAM,cACL,qBAAqB,SAgUpC,CAAC;IAEF;;;;;;;;;;;;;;;;OAgBG;IACI,MAAM,4CAA4C,4BAC5B,mBAAmB,8BAChB,mBAAmB,eAClC,MAAM,aACR,MAAM,8BACW,OAAO,iBACpB,YAAY,EAAE,cACjB,qBAAqB,SA+UpC,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,gCAAgC,uBAAgC,mBAAmB,sBAAsB,OAAO,SAwD5H,CAAC;CACL"}
1
+ {"version":3,"file":"indexedCollection.d.ts","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAWH,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAqCxF,yBAAiB,mCAAmC,CAAC;IACjD;;;;;;;;;;;;;;OAcG;IACI,MAAM,6CAA6C,2BAC9B,mBAAmB,6BAChB,mBAAmB,aACnC,MAAM,cACL,qBAAqB,SAgUpC,CAAC;IAEF;;;;;;;;;;;;;;;;OAgBG;IACI,MAAM,4CAA4C,4BAC5B,mBAAmB,8BAChB,mBAAmB,eAClC,MAAM,aACR,MAAM,8BACW,OAAO,iBACpB,YAAY,EAAE,cACjB,qBAAqB,SAiVpC,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,gCAAgC,uBAAgC,mBAAmB,sBAAsB,OAAO,SAwD5H,CAAC;CACL"}
@@ -568,19 +568,21 @@ var ChangeSetIndexedCollectionFunctions;
568
568
  delete modifyMap[key];
569
569
  }
570
570
  else if (modification.own === "remove_insert" && modification.other === "modify") {
571
- // We have a conflicting change. A node was removed and inserted (replaced) in the original
572
- // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification
573
- // can have been changed significantly by this operation, we don't know whether we can
574
- // apply the modification
575
- // Create the conflict information
576
- let conflict = {
577
- path: newPath,
578
- type: changesetConflictTypes_1.ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,
579
- conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],
580
- };
581
- out_conflicts.push(conflict);
582
- // Delete the modification from the rebased ChangeSet
583
- delete io_rebasePropertyChangeSet.modify[key];
571
+ if (!isPrimitiveTypeid) {
572
+ // We have a conflicting change. A node was removed and inserted (replaced) in the original
573
+ // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification
574
+ // can have been changed significantly by this operation, we don't know whether we can
575
+ // apply the modification
576
+ // Create the conflict information
577
+ let conflict = {
578
+ path: newPath,
579
+ type: changesetConflictTypes_1.ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,
580
+ conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],
581
+ };
582
+ out_conflicts.push(conflict);
583
+ // Delete the modification from the rebased ChangeSet
584
+ delete io_rebasePropertyChangeSet.modify[modification.otherTypeid][key];
585
+ }
584
586
  }
585
587
  else if ((modification.own === "modify" || modification.own === "remove") &&
586
588
  (modification.other === "remove" || modification.other === "remove_insert")) {
@@ -1 +1 @@
1
- {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;;;;AAEF,yDAAsD;AACtD,6DAAqC;AACrC,6D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AAC,CAAC,CAAC,CAAC;qBAClC;iBACJ;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACJ;SACJ;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACpC,OAAO,OAAO,CAAC,MAAM,CAAC;SACzB;IACL,CAAC,CAAC;AACN,CAAC,EA/vBgB,mCAAmC,GAAnC,2CAAmC,KAAnC,2CAAmC,QA+vBnD","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\n import { copy as cloneDeep } from \"fastest-json-copy\";\n import isEmpty from \"lodash/isEmpty\";\n import isEqual from \"lodash/isEqual\";\n import isObject from \"lodash/isObject\";\n import without from \"lodash/without\";\n import 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 if (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n return isEmpty(in_object);\n }\n\n // eslint-disable-next-line guard-for-in\n for (const _entry in in_object) {\n return false;\n }\n\n return true;\n};\n\nexport namespace ChangeSetIndexedCollectionFunctions {\n /**\n * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n *\n * @param io_basePropertyChanges - The ChangeSet describing the initial state\n * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n * @param in_typeid - The typeid of the contents collection\n * (without the collection type)\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _performApplyAfterOnPropertyIndexedCollection = function(\n io_basePropertyChanges: SerializedChangeSet, // eslint-disable-line complexity\n in_appliedPropertyChanges: SerializedChangeSet,\n in_typeid: string,\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n // Handle remove entry operations\n if (in_appliedPropertyChanges.remove) {\n // Get and initialize the corresponding entries in the existing collection\n let removedEntries = in_appliedPropertyChanges.remove;\n\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.remove = io_basePropertyChanges.remove ||\n (Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n let baseInserted = io_basePropertyChanges.insert || {};\n let baseRemoved = io_basePropertyChanges.remove;\n let baseModified = io_basePropertyChanges.modify;\n let done = false;\n\n if (!Array.isArray(removedEntries)) {\n if (isPrimitiveTypeid) {\n removedEntries = Object.keys(removedEntries);\n } else {\n // this is a reversible change set of templated types\n const removedTypes = Object.keys(removedEntries);\n for (let t = 0; t < removedTypes.length; t++) {\n const removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n for (let i = 0; i < removedKeys.length; i++) {\n if (baseInserted[removedTypes[t]] &&\n baseInserted[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseInserted[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n delete baseInserted[removedTypes[t]];\n }\n } else {\n if (baseModified && baseModified[removedTypes[t]] &&\n baseModified[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseModified[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n delete baseModified[removedTypes[t]];\n }\n }\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(removedKeys[i]);\n } else {\n if (!baseRemoved[removedTypes[t]]) {\n baseRemoved[removedTypes[t]] = {};\n }\n baseRemoved[removedTypes[t]][removedKeys[i]] = removedEntries[removedTypes[t]][removedKeys[i]];\n }\n }\n }\n }\n done = true;\n }\n }\n\n if (!done) {\n if (isPrimitiveTypeid) {\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n\n // If there is an insert for this key, we just remove it\n if (baseInserted[key] !== undefined) {\n delete baseInserted[key];\n } else {\n // There could be a modify entry for this key, which we have to remove\n if (baseModified && baseModified[key] !== undefined) {\n delete baseModified[key];\n }\n\n // Otherwise we add it to the remove list\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(key);\n } else {\n baseRemoved[key] = in_appliedPropertyChanges.remove[key];\n }\n }\n }\n } else {\n const baseInsertedTypeids = Object.keys(baseInserted);\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n let foundInTypeid;\n\n // Since we only have a flat remove list (without typeid) in the changeset, we have\n // to check all inserts\n for (let j = 0; j < baseInsertedTypeids.length; j++) {\n if (baseInserted[baseInsertedTypeids[j]] &&\n baseInserted[baseInsertedTypeids[j]][key] !== undefined) {\n foundInTypeid = baseInsertedTypeids[j];\n break;\n }\n }\n\n if (foundInTypeid) {\n // If this key was inserted by this ChangeSet, we just remove it from the inserted list\n delete baseInserted[foundInTypeid][key];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted or modified section\n if (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n delete baseInserted[foundInTypeid];\n }\n if (baseModified && isEmpty(baseModified[foundInTypeid])) {\n delete baseModified[foundInTypeid];\n }\n } else {\n // There could be a modify entry for this key, which we have to remove\n const baseModifiedTypeids = Object.keys(baseModified || {});\n for (let j = 0; j < baseModifiedTypeids.length; j++) {\n if (baseModified[baseModifiedTypeids[j]][key]) {\n foundInTypeid = baseModifiedTypeids[j];\n delete baseModified[foundInTypeid][key];\n break;\n }\n }\n\n // Otherwise we add it to the remove list\n baseRemoved.push(key);\n }\n }\n }\n }\n }\n\n // Apply insert operations\n if (in_appliedPropertyChanges.insert) {\n // Get and initialize the corresponding entries from the existing collection\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n let baseInserted = io_basePropertyChanges.insert;\n let baseRemoved = io_basePropertyChanges.remove;\n\n // Insert the inserted entries\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const insertedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(in_appliedPropertyChanges.insert);\n for (let i = 0; i < insertedTypeids.length; i++) {\n let typeid = insertedTypeids[i];\n const insertedEntries = isPrimitiveTypeid ?\n in_appliedPropertyChanges.insert : in_appliedPropertyChanges.insert[typeid];\n const insertedKeys = Object.keys(insertedEntries);\n let removalCS;\n if (baseRemoved) {\n removalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n }\n for (let j = 0; j < insertedKeys.length; j++) {\n let key = insertedKeys[j];\n let deeplyEqualCS = false;\n\n // If we have a complex type in the collection, we need to do a deep comparison of the two\n // ChangeSets to determine, whether they are equal\n // TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n // Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n // the insert is reinserting exactly what was removed.\n if (!isPrimitiveTypeid && removalCS && isObject(removalCS) && removalCS[key] !== undefined) {\n // Split out the two parts: all the keys other than remove/insert should match exactly.\n // The contents 'remove' and 'insert', if they exist, should also match.\n deeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n // If there are 'insert' and 'remove', see if the removed data matches the inserted data\n if (deeplyEqualCS && insertedEntries[key].insert) {\n deeplyEqualCS = isEqual(\n insertedEntries[key].insert,\n removalCS[key].remove,\n );\n }\n\n // Finally, check if the data being inserted matches the data that was removed\n const insertedEntry = isObject(insertedEntries[key]) ? without(insertedEntries[key], \"insert\") : insertedEntries[key];\n const removedEntry = isObject(removalCS[key]) ? without(removalCS[key], \"remove\") : removalCS[key];\n deeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n }\n\n if ((isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n removalCS &&\n ((Array.isArray(removalCS) && includes(baseRemoved, key)) || removalCS[key] !== undefined)) {\n // A remove and insert are combined into a modify for primitive types\n\n // Remove the old remove command\n let oldValueMatches = false;\n if (Array.isArray(removalCS)) {\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n } else {\n io_basePropertyChanges.remove[typeid] = without(io_basePropertyChanges.remove[typeid], key);\n }\n } else {\n oldValueMatches = deeplyEqualCS || (removalCS[key] === insertedEntries[key]);\n delete removalCS[key];\n }\n\n // Insert a modify command instead\n if (!oldValueMatches) {\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.modify[key] = insertedEntries[key];\n } else {\n io_basePropertyChanges.modify[typeid] = io_basePropertyChanges.modify[typeid] || {};\n io_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n }\n }\n } else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n baseInserted[key] = insertedEntries[key];\n } else if (!isPrimitiveTypeid && (!baseInserted[typeid] || baseInserted[typeid][key] === undefined)) {\n baseInserted[typeid] = baseInserted[typeid] || {};\n baseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n } else {\n throw new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n }\n }\n }\n }\n\n // Handle modification operations\n if (in_appliedPropertyChanges.modify) {\n // Get and initialize the corresponding entries from the existing collection\n const modifiedEntries = in_appliedPropertyChanges.modify;\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n let baseModified = io_basePropertyChanges.modify;\n let baseInserted = io_basePropertyChanges.insert || {};\n\n // Process the modifications\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n for (let i = 0; i < modifiedTypeids.length; i++) {\n let typeid = modifiedTypeids[i];\n\n const modifyKeys = Object.keys(isPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid]);\n for (let j = 0; j < modifyKeys.length; j++) {\n let key = modifyKeys[j];\n\n if (isPrimitiveTypeid) {\n let newValue = modifiedEntries[key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = newValue.value;\n }\n if (baseInserted[key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n baseInserted[key] = newValue;\n } else {\n if (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n baseModified[key].value = newValue;\n } else {\n baseModified[key] = newValue;\n }\n }\n } else {\n // If this is a polymorphic collection, we can still have individual entries with\n // primitive types\n const isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n if (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n if (isEntryPrimitiveType && typeid !== \"String\") {\n let newValue = modifiedEntries[typeid][key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = modifiedEntries[typeid][key].value;\n }\n\n // In the case of Int64 or Uint64 we copy the array so that\n // both ChangeSets don't point to the same instance\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n newValue = newValue.slice();\n }\n\n if (baseInserted[typeid][key] && baseInserted[typeid][key].hasOwnProperty(\"value\")) {\n baseInserted[typeid][key].value = newValue;\n } else {\n baseInserted[typeid][key] = newValue;\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseInserted[typeid],\n modifiedEntries[typeid],\n typeid,\n false,\n in_options);\n }\n } else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n // If there was a previous modification operation, we have to merge the two\n if (isEntryPrimitiveType && typeid !== \"String\") {\n // Primitive types can simply be overwritten, however we have an exception for\n // 64 bit integers (until javascript natively supports them)\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n let appliedVal = modifiedEntries[typeid][key];\n if (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n appliedVal = appliedVal.value;\n }\n baseModified[typeid][key] = appliedVal.slice();\n } else {\n baseModified[typeid][key] = modifiedEntries[typeid][key];\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseModified[typeid],\n modifiedEntries[typeid],\n typeid,\n true,\n in_options);\n }\n } else {\n baseModified[typeid] = baseModified[typeid] || {};\n baseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n }\n }\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n };\n\n /**\n * Performs the rebase operation for set and map collections\n *\n * @param in_ownPropertyChangeSet - The ChangeSet for this collection\n * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased\n * @param in_basePath - Base path to get to the property processed by this function\n * @param in_typeid - The typeid of the contents collection (without the collection type)\n * @param in_useSquareBracketsInPath -\n * If set to true, paths will be created using the angular brackets syntax (for\n * arrays), otherwise dots will be used (for NodeProperties)\n * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _rebaseIndexedCollectionChangeSetForProperty = function(\n in_ownPropertyChangeSet: SerializedChangeSet, // eslint-disable-line complexity\n io_rebasePropertyChangeSet: SerializedChangeSet,\n in_basePath: string,\n in_typeid: string,\n in_useSquareBracketsInPath: boolean,\n out_conflicts: ConflictInfo[],\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n const changesByKeys = {};\n let modifyMap = {};\n // Helper function which stores the changes indexed by key in the changesByKeys array to\n // make it easier to compare the related changes in the two ChangeSets\n const addChanges = function(in_collection: Record<string, any>, in_changeIdentifier: string, in_changePrefix: string, in_typeidChange?: string) {\n // Collection didn't exist in this ChangeSet\n if (in_collection === undefined) {\n return;\n }\n\n // For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n // distinguish the two cases here\n const keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n // Add all entries indexed with the key\n for (let j = 0; j < keys.length; j++) {\n const key = keys[j];\n\n // Store the type of the change\n changesByKeys[key] = changesByKeys[key] || {};\n changesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix] ?\n `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}` :\n in_changeIdentifier;\n\n // If applicable store the typeid of the change\n if (in_typeidChange) {\n changesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n }\n\n // Store the ChangeSet\n if (in_changePrefix === \"other\") {\n if (!Array.isArray(in_collection)) {\n changesByKeys[key].change = in_collection[key];\n } else {\n changesByKeys[key].change = key;\n }\n }\n }\n };\n\n // Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n const addChangesWithTypeids = function(in_collection, in_changeIdentifier, in_changePrefix) {\n if (in_collection === undefined) {\n return;\n }\n // Iterate over the typeids (or use dummy entry for the iteration\n const addedKeyTypeids = Object.keys(in_collection);\n for (let i = 0; i < addedKeyTypeids.length; i++) {\n const Typeid = addedKeyTypeids[i];\n addChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n }\n };\n\n // Insert all changes from the ChangeSet into the lookup map\n if (Array.isArray(in_ownPropertyChangeSet.remove)) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n }\n }\n\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n addChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n }\n }\n\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n }\n\n // Check for modifications that affect the same object\n const changedKeys = Object.keys(changesByKeys);\n for (let i = 0; i < changedKeys.length; i++) {\n const key = changedKeys[i];\n const newPath = in_useSquareBracketsInPath ?\n `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]` :\n joinPaths(in_basePath, PathHelper.quotePathSegmentIfNeeded(key), PROPERTY_PATH_DELIMITER);\n\n const modification = changesByKeys[key];\n if (modification.own && modification.other) {\n /*\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 // A key was modified after it had been removed\n if (modification.own === \"modify\" && modification.other === \"modify\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid) && modification.ownTypeid !== \"String\")) {\n // We have two modification operations that affect the same entry for a base type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflict\n let ownModify = in_ownPropertyChangeSet.modify;\n let rebasedModify = io_rebasePropertyChangeSet.modify;\n if (modification.otherTypeid) {\n ownModify = ownModify[modification.otherTypeid];\n rebasedModify = rebasedModify[modification.otherTypeid];\n }\n\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: ownModify[key],\n };\n out_conflicts.push(conflict);\n // If value is the same, delete the entry\n let ownValue = ownModify[key];\n if (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n ownValue = ownValue.value;\n }\n let rebaseValue = rebasedModify[key];\n if (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n rebaseValue = rebaseValue.value;\n }\n if (modification.ownTypeid === \"Int64\" || modification.ownTypeid === \"Uint64\" || ownValue.length === 2) {\n // For (u)int64, values are arrays of 2 elements\n if (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n delete rebasedModify[key];\n }\n } else {\n if (ownValue === rebaseValue) {\n delete rebasedModify[key];\n }\n }\n } else {\n this.rebaseChangeSetForPropertyEntryWithTypeid(key,\n in_ownPropertyChangeSet.modify[modification.ownTypeid],\n io_rebasePropertyChangeSet.modify[modification.otherTypeid],\n modification.ownTypeid,\n newPath,\n true,\n out_conflicts,\n in_options);\n }\n } else if (modification.own === \"remove\" && modification.other === \"modify\") {\n modifyMap = modification.otherTypeid ? io_rebasePropertyChangeSet.modify[modification.otherTypeid] :\n io_rebasePropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete modifyMap[key];\n } else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\n // We have a conflicting change. A node was removed and inserted (replaced) in the original\n // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n // can have been changed significantly by this operation, we don't know whether we can\n // apply the modification\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete io_rebasePropertyChangeSet.modify[key];\n } else if ((modification.own === \"modify\" || modification.own === \"remove\") &&\n (modification.other === \"remove\" || modification.other === \"remove_insert\")) {\n if (modification.own === \"modify\") {\n modifyMap = modification.ownTypeid ? in_ownPropertyChangeSet.modify[modification.ownTypeid] :\n in_ownPropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.REMOVE_AFTER_MODIFY,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n }\n\n // If we have a duplicated delete, we remove it from the new ChangeSet\n if (modification.own === \"remove\") {\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n io_rebasePropertyChangeSet.remove = without(io_rebasePropertyChangeSet.remove, key);\n } else {\n if (isPrimitiveTypeid) {\n delete io_rebasePropertyChangeSet.remove[key];\n } else {\n delete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n }\n }\n }\n } else if (modification.own === \"insert\" && modification.other === \"insert\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid))) {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // We have two insert operations that affect the same key for a primitive type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflicting set\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Convert to modify\n let oldValue;\n if (modification.otherTypeid) {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n modifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n oldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n } else {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n modifyMap = io_rebasePropertyChangeSet.modify;\n oldValue = in_ownPropertyChangeSet.insert[key];\n }\n\n modifyMap[key] = { value: insertMap[key], oldValue };\n delete insertMap[key];\n } else {\n // Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n // just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete insertMap[key];\n }\n } else if (modification.own === \"remove_insert\" && modification.other === \"remove_insert\") {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Raise the duplicate inserts as a conflict\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n } else {\n // All other operations are conflicting changes, which only occur for ChangeSets that are relative\n // to different bases\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INVALID_CHANGESET_BASE,\n conflictingChange: modification.change,\n };\n out_conflicts.push(conflict);\n\n // Remove the change from the ChangeSet\n if (modification.other !== \"remove\") {\n if (modification.otherTypeid !== undefined) {\n delete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][key];\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n } else {\n // Remove remove operations from the ChangeSet\n if (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n io_rebasePropertyChangeSet[modification.other] =\n without(io_rebasePropertyChangeSet[modification.other], key);\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n }\n\n console.error(\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\");\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n };\n\n /**\n * Removes empty entries from the .children collection of the ChangeSet\n *\n * @param in_propertyChanges - The ChangeSet to clean up\n * @param in_containsTypeids - Does this ChangeSet contain typeids\n * @private\n */\n export const _cleanIndexedCollectionChangeSet = function(in_propertyChanges: SerializedChangeSet, in_containsTypeids: boolean) {\n const changes = in_propertyChanges;\n // Clean inserts\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.insert || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n delete changes.insert[typeidList[j]];\n }\n }\n }\n\n // Remove add group if no operations are present\n if (_fastIsEmptyObject(changes.insert)) {\n delete changes.insert;\n }\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.remove || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n delete changes.remove[typeidList[j]];\n }\n }\n }\n // Remove remove group if no operations are present\n if (_fastIsEmptyObject(changes.remove)) {\n delete changes.remove;\n }\n\n // Clean modifies\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.modify || {});\n for (let j = 0; j < typeidList.length; j++) {\n const modifies = changes.modify[typeidList[j]];\n const modifyKeys = Object.keys(modifies);\n for (let k = 0; k < modifyKeys.length; k++) {\n if (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n delete modifies[modifyKeys[k]];\n }\n }\n if (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n delete changes.modify[typeidList[j]];\n }\n }\n }\n\n // Remove modify group if no operations are present\n if (_fastIsEmptyObject(changes.modify)) {\n delete changes.modify;\n }\n };\n}\n"]}
1
+ {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH;;GAEG;;;;;;AAEF,yDAAsD;AACtD,6DAAqC;AACrC,6DAAqC;AACrC,+DAAuC;AACvC,6DAAqC;AACrC,+DAA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AAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;qBAClC;iBACJ;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACJ;SACJ;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACpC,OAAO,OAAO,CAAC,MAAM,CAAC;SACzB;IACL,CAAC,CAAC;AACN,CAAC,EAjwBgB,mCAAmC,GAAnC,2CAAmC,KAAnC,2CAAmC,QAiwBnD","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\n import { copy as cloneDeep } from \"fastest-json-copy\";\n import isEmpty from \"lodash/isEmpty\";\n import isEqual from \"lodash/isEqual\";\n import isObject from \"lodash/isObject\";\n import without from \"lodash/without\";\n import 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 if (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n return isEmpty(in_object);\n }\n\n // eslint-disable-next-line guard-for-in\n for (const _entry in in_object) {\n return false;\n }\n\n return true;\n};\n\nexport namespace ChangeSetIndexedCollectionFunctions {\n /**\n * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n *\n * @param io_basePropertyChanges - The ChangeSet describing the initial state\n * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n * @param in_typeid - The typeid of the contents collection\n * (without the collection type)\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _performApplyAfterOnPropertyIndexedCollection = function(\n io_basePropertyChanges: SerializedChangeSet, // eslint-disable-line complexity\n in_appliedPropertyChanges: SerializedChangeSet,\n in_typeid: string,\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n // Handle remove entry operations\n if (in_appliedPropertyChanges.remove) {\n // Get and initialize the corresponding entries in the existing collection\n let removedEntries = in_appliedPropertyChanges.remove;\n\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.remove = io_basePropertyChanges.remove ||\n (Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n let baseInserted = io_basePropertyChanges.insert || {};\n let baseRemoved = io_basePropertyChanges.remove;\n let baseModified = io_basePropertyChanges.modify;\n let done = false;\n\n if (!Array.isArray(removedEntries)) {\n if (isPrimitiveTypeid) {\n removedEntries = Object.keys(removedEntries);\n } else {\n // this is a reversible change set of templated types\n const removedTypes = Object.keys(removedEntries);\n for (let t = 0; t < removedTypes.length; t++) {\n const removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n for (let i = 0; i < removedKeys.length; i++) {\n if (baseInserted[removedTypes[t]] &&\n baseInserted[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseInserted[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n delete baseInserted[removedTypes[t]];\n }\n } else {\n if (baseModified && baseModified[removedTypes[t]] &&\n baseModified[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseModified[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n delete baseModified[removedTypes[t]];\n }\n }\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(removedKeys[i]);\n } else {\n if (!baseRemoved[removedTypes[t]]) {\n baseRemoved[removedTypes[t]] = {};\n }\n baseRemoved[removedTypes[t]][removedKeys[i]] = removedEntries[removedTypes[t]][removedKeys[i]];\n }\n }\n }\n }\n done = true;\n }\n }\n\n if (!done) {\n if (isPrimitiveTypeid) {\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n\n // If there is an insert for this key, we just remove it\n if (baseInserted[key] !== undefined) {\n delete baseInserted[key];\n } else {\n // There could be a modify entry for this key, which we have to remove\n if (baseModified && baseModified[key] !== undefined) {\n delete baseModified[key];\n }\n\n // Otherwise we add it to the remove list\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(key);\n } else {\n baseRemoved[key] = in_appliedPropertyChanges.remove[key];\n }\n }\n }\n } else {\n const baseInsertedTypeids = Object.keys(baseInserted);\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n let foundInTypeid;\n\n // Since we only have a flat remove list (without typeid) in the changeset, we have\n // to check all inserts\n for (let j = 0; j < baseInsertedTypeids.length; j++) {\n if (baseInserted[baseInsertedTypeids[j]] &&\n baseInserted[baseInsertedTypeids[j]][key] !== undefined) {\n foundInTypeid = baseInsertedTypeids[j];\n break;\n }\n }\n\n if (foundInTypeid) {\n // If this key was inserted by this ChangeSet, we just remove it from the inserted list\n delete baseInserted[foundInTypeid][key];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted or modified section\n if (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n delete baseInserted[foundInTypeid];\n }\n if (baseModified && isEmpty(baseModified[foundInTypeid])) {\n delete baseModified[foundInTypeid];\n }\n } else {\n // There could be a modify entry for this key, which we have to remove\n const baseModifiedTypeids = Object.keys(baseModified || {});\n for (let j = 0; j < baseModifiedTypeids.length; j++) {\n if (baseModified[baseModifiedTypeids[j]][key]) {\n foundInTypeid = baseModifiedTypeids[j];\n delete baseModified[foundInTypeid][key];\n break;\n }\n }\n\n // Otherwise we add it to the remove list\n baseRemoved.push(key);\n }\n }\n }\n }\n }\n\n // Apply insert operations\n if (in_appliedPropertyChanges.insert) {\n // Get and initialize the corresponding entries from the existing collection\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n let baseInserted = io_basePropertyChanges.insert;\n let baseRemoved = io_basePropertyChanges.remove;\n\n // Insert the inserted entries\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const insertedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(in_appliedPropertyChanges.insert);\n for (let i = 0; i < insertedTypeids.length; i++) {\n let typeid = insertedTypeids[i];\n const insertedEntries = isPrimitiveTypeid ?\n in_appliedPropertyChanges.insert : in_appliedPropertyChanges.insert[typeid];\n const insertedKeys = Object.keys(insertedEntries);\n let removalCS;\n if (baseRemoved) {\n removalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n }\n for (let j = 0; j < insertedKeys.length; j++) {\n let key = insertedKeys[j];\n let deeplyEqualCS = false;\n\n // If we have a complex type in the collection, we need to do a deep comparison of the two\n // ChangeSets to determine, whether they are equal\n // TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n // Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n // the insert is reinserting exactly what was removed.\n if (!isPrimitiveTypeid && removalCS && isObject(removalCS) && removalCS[key] !== undefined) {\n // Split out the two parts: all the keys other than remove/insert should match exactly.\n // The contents 'remove' and 'insert', if they exist, should also match.\n deeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n // If there are 'insert' and 'remove', see if the removed data matches the inserted data\n if (deeplyEqualCS && insertedEntries[key].insert) {\n deeplyEqualCS = isEqual(\n insertedEntries[key].insert,\n removalCS[key].remove,\n );\n }\n\n // Finally, check if the data being inserted matches the data that was removed\n const insertedEntry = isObject(insertedEntries[key]) ? without(insertedEntries[key], \"insert\") : insertedEntries[key];\n const removedEntry = isObject(removalCS[key]) ? without(removalCS[key], \"remove\") : removalCS[key];\n deeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n }\n\n if ((isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n removalCS &&\n ((Array.isArray(removalCS) && includes(baseRemoved, key)) || removalCS[key] !== undefined)) {\n // A remove and insert are combined into a modify for primitive types\n\n // Remove the old remove command\n let oldValueMatches = false;\n if (Array.isArray(removalCS)) {\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n } else {\n io_basePropertyChanges.remove[typeid] = without(io_basePropertyChanges.remove[typeid], key);\n }\n } else {\n oldValueMatches = deeplyEqualCS || (removalCS[key] === insertedEntries[key]);\n delete removalCS[key];\n }\n\n // Insert a modify command instead\n if (!oldValueMatches) {\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.modify[key] = insertedEntries[key];\n } else {\n io_basePropertyChanges.modify[typeid] = io_basePropertyChanges.modify[typeid] || {};\n io_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n }\n }\n } else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n baseInserted[key] = insertedEntries[key];\n } else if (!isPrimitiveTypeid && (!baseInserted[typeid] || baseInserted[typeid][key] === undefined)) {\n baseInserted[typeid] = baseInserted[typeid] || {};\n baseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n } else {\n throw new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n }\n }\n }\n }\n\n // Handle modification operations\n if (in_appliedPropertyChanges.modify) {\n // Get and initialize the corresponding entries from the existing collection\n const modifiedEntries = in_appliedPropertyChanges.modify;\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n let baseModified = io_basePropertyChanges.modify;\n let baseInserted = io_basePropertyChanges.insert || {};\n\n // Process the modifications\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n for (let i = 0; i < modifiedTypeids.length; i++) {\n let typeid = modifiedTypeids[i];\n\n const modifyKeys = Object.keys(isPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid]);\n for (let j = 0; j < modifyKeys.length; j++) {\n let key = modifyKeys[j];\n\n if (isPrimitiveTypeid) {\n let newValue = modifiedEntries[key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = newValue.value;\n }\n if (baseInserted[key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n baseInserted[key] = newValue;\n } else {\n if (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n baseModified[key].value = newValue;\n } else {\n baseModified[key] = newValue;\n }\n }\n } else {\n // If this is a polymorphic collection, we can still have individual entries with\n // primitive types\n const isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n if (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n if (isEntryPrimitiveType && typeid !== \"String\") {\n let newValue = modifiedEntries[typeid][key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = modifiedEntries[typeid][key].value;\n }\n\n // In the case of Int64 or Uint64 we copy the array so that\n // both ChangeSets don't point to the same instance\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n newValue = newValue.slice();\n }\n\n if (baseInserted[typeid][key] && baseInserted[typeid][key].hasOwnProperty(\"value\")) {\n baseInserted[typeid][key].value = newValue;\n } else {\n baseInserted[typeid][key] = newValue;\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseInserted[typeid],\n modifiedEntries[typeid],\n typeid,\n false,\n in_options);\n }\n } else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n // If there was a previous modification operation, we have to merge the two\n if (isEntryPrimitiveType && typeid !== \"String\") {\n // Primitive types can simply be overwritten, however we have an exception for\n // 64 bit integers (until javascript natively supports them)\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n let appliedVal = modifiedEntries[typeid][key];\n if (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n appliedVal = appliedVal.value;\n }\n baseModified[typeid][key] = appliedVal.slice();\n } else {\n baseModified[typeid][key] = modifiedEntries[typeid][key];\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseModified[typeid],\n modifiedEntries[typeid],\n typeid,\n true,\n in_options);\n }\n } else {\n baseModified[typeid] = baseModified[typeid] || {};\n baseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n }\n }\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n };\n\n /**\n * Performs the rebase operation for set and map collections\n *\n * @param in_ownPropertyChangeSet - The ChangeSet for this collection\n * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased\n * @param in_basePath - Base path to get to the property processed by this function\n * @param in_typeid - The typeid of the contents collection (without the collection type)\n * @param in_useSquareBracketsInPath -\n * If set to true, paths will be created using the angular brackets syntax (for\n * arrays), otherwise dots will be used (for NodeProperties)\n * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _rebaseIndexedCollectionChangeSetForProperty = function(\n in_ownPropertyChangeSet: SerializedChangeSet, // eslint-disable-line complexity\n io_rebasePropertyChangeSet: SerializedChangeSet,\n in_basePath: string,\n in_typeid: string,\n in_useSquareBracketsInPath: boolean,\n out_conflicts: ConflictInfo[],\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n const changesByKeys = {};\n let modifyMap = {};\n // Helper function which stores the changes indexed by key in the changesByKeys array to\n // make it easier to compare the related changes in the two ChangeSets\n const addChanges = function(in_collection: Record<string, any>, in_changeIdentifier: string, in_changePrefix: string, in_typeidChange?: string) {\n // Collection didn't exist in this ChangeSet\n if (in_collection === undefined) {\n return;\n }\n\n // For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n // distinguish the two cases here\n const keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n // Add all entries indexed with the key\n for (let j = 0; j < keys.length; j++) {\n const key = keys[j];\n\n // Store the type of the change\n changesByKeys[key] = changesByKeys[key] || {};\n changesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix] ?\n `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}` :\n in_changeIdentifier;\n\n // If applicable store the typeid of the change\n if (in_typeidChange) {\n changesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n }\n\n // Store the ChangeSet\n if (in_changePrefix === \"other\") {\n if (!Array.isArray(in_collection)) {\n changesByKeys[key].change = in_collection[key];\n } else {\n changesByKeys[key].change = key;\n }\n }\n }\n };\n\n // Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n const addChangesWithTypeids = function(in_collection, in_changeIdentifier, in_changePrefix) {\n if (in_collection === undefined) {\n return;\n }\n // Iterate over the typeids (or use dummy entry for the iteration\n const addedKeyTypeids = Object.keys(in_collection);\n for (let i = 0; i < addedKeyTypeids.length; i++) {\n const Typeid = addedKeyTypeids[i];\n addChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n }\n };\n\n // Insert all changes from the ChangeSet into the lookup map\n if (Array.isArray(in_ownPropertyChangeSet.remove)) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n }\n }\n\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n addChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n }\n }\n\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n }\n\n // Check for modifications that affect the same object\n const changedKeys = Object.keys(changesByKeys);\n for (let i = 0; i < changedKeys.length; i++) {\n const key = changedKeys[i];\n const newPath = in_useSquareBracketsInPath ?\n `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]` :\n joinPaths(in_basePath, PathHelper.quotePathSegmentIfNeeded(key), PROPERTY_PATH_DELIMITER);\n\n const modification = changesByKeys[key];\n if (modification.own && modification.other) {\n /*\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 // A key was modified after it had been removed\n if (modification.own === \"modify\" && modification.other === \"modify\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid) && modification.ownTypeid !== \"String\")) {\n // We have two modification operations that affect the same entry for a base type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflict\n let ownModify = in_ownPropertyChangeSet.modify;\n let rebasedModify = io_rebasePropertyChangeSet.modify;\n if (modification.otherTypeid) {\n ownModify = ownModify[modification.otherTypeid];\n rebasedModify = rebasedModify[modification.otherTypeid];\n }\n\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: ownModify[key],\n };\n out_conflicts.push(conflict);\n // If value is the same, delete the entry\n let ownValue = ownModify[key];\n if (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n ownValue = ownValue.value;\n }\n let rebaseValue = rebasedModify[key];\n if (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n rebaseValue = rebaseValue.value;\n }\n if (modification.ownTypeid === \"Int64\" || modification.ownTypeid === \"Uint64\" || ownValue.length === 2) {\n // For (u)int64, values are arrays of 2 elements\n if (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n delete rebasedModify[key];\n }\n } else {\n if (ownValue === rebaseValue) {\n delete rebasedModify[key];\n }\n }\n } else {\n this.rebaseChangeSetForPropertyEntryWithTypeid(key,\n in_ownPropertyChangeSet.modify[modification.ownTypeid],\n io_rebasePropertyChangeSet.modify[modification.otherTypeid],\n modification.ownTypeid,\n newPath,\n true,\n out_conflicts,\n in_options);\n }\n } else if (modification.own === \"remove\" && modification.other === \"modify\") {\n modifyMap = modification.otherTypeid ? io_rebasePropertyChangeSet.modify[modification.otherTypeid] :\n io_rebasePropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete modifyMap[key];\n } else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\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 conflictingChange: io_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 } else if ((modification.own === \"modify\" || modification.own === \"remove\") &&\n (modification.other === \"remove\" || modification.other === \"remove_insert\")) {\n if (modification.own === \"modify\") {\n modifyMap = modification.ownTypeid ? in_ownPropertyChangeSet.modify[modification.ownTypeid] :\n in_ownPropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.REMOVE_AFTER_MODIFY,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n }\n\n // If we have a duplicated delete, we remove it from the new ChangeSet\n if (modification.own === \"remove\") {\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n io_rebasePropertyChangeSet.remove = without(io_rebasePropertyChangeSet.remove, key);\n } else {\n if (isPrimitiveTypeid) {\n delete io_rebasePropertyChangeSet.remove[key];\n } else {\n delete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n }\n }\n }\n } else if (modification.own === \"insert\" && modification.other === \"insert\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid))) {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // We have two insert operations that affect the same key for a primitive type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflicting set\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Convert to modify\n let oldValue;\n if (modification.otherTypeid) {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n modifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n oldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n } else {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n modifyMap = io_rebasePropertyChangeSet.modify;\n oldValue = in_ownPropertyChangeSet.insert[key];\n }\n\n modifyMap[key] = { value: insertMap[key], oldValue };\n delete insertMap[key];\n } else {\n // Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n // just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete insertMap[key];\n }\n } else if (modification.own === \"remove_insert\" && modification.other === \"remove_insert\") {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Raise the duplicate inserts as a conflict\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n } else {\n // All other operations are conflicting changes, which only occur for ChangeSets that are relative\n // to different bases\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INVALID_CHANGESET_BASE,\n conflictingChange: modification.change,\n };\n out_conflicts.push(conflict);\n\n // Remove the change from the ChangeSet\n if (modification.other !== \"remove\") {\n if (modification.otherTypeid !== undefined) {\n delete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][key];\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n } else {\n // Remove remove operations from the ChangeSet\n if (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n io_rebasePropertyChangeSet[modification.other] =\n without(io_rebasePropertyChangeSet[modification.other], key);\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n }\n\n console.error(\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\");\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n };\n\n /**\n * Removes empty entries from the .children collection of the ChangeSet\n *\n * @param in_propertyChanges - The ChangeSet to clean up\n * @param in_containsTypeids - Does this ChangeSet contain typeids\n * @private\n */\n export const _cleanIndexedCollectionChangeSet = function(in_propertyChanges: SerializedChangeSet, in_containsTypeids: boolean) {\n const changes = in_propertyChanges;\n // Clean inserts\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.insert || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n delete changes.insert[typeidList[j]];\n }\n }\n }\n\n // Remove add group if no operations are present\n if (_fastIsEmptyObject(changes.insert)) {\n delete changes.insert;\n }\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.remove || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n delete changes.remove[typeidList[j]];\n }\n }\n }\n // Remove remove group if no operations are present\n if (_fastIsEmptyObject(changes.remove)) {\n delete changes.remove;\n }\n\n // Clean modifies\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.modify || {});\n for (let j = 0; j < typeidList.length; j++) {\n const modifies = changes.modify[typeidList[j]];\n const modifyKeys = Object.keys(modifies);\n for (let k = 0; k < modifyKeys.length; k++) {\n if (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n delete modifies[modifyKeys[k]];\n }\n }\n if (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n delete changes.modify[typeidList[j]];\n }\n }\n }\n\n // Remove modify group if no operations are present\n if (_fastIsEmptyObject(changes.modify)) {\n delete changes.modify;\n }\n };\n}\n"]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /*!
4
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ const chai_1 = require("chai");
8
+ const lodash_1 = require("lodash");
9
+ const changeset_1 = require("../changeset");
10
+ describe("Indexed Collection Operations", function () {
11
+ it("modifications should rebase to a NOP for polymorphic collection, when the type of a primitive property changes in the base ChangeSet", () => {
12
+ // Modification to a float property
13
+ const modification = {
14
+ modify: {
15
+ Float64: {
16
+ test: {
17
+ value: 10,
18
+ oldValue: 5,
19
+ },
20
+ },
21
+ },
22
+ };
23
+ // Base Changeset that changes the typeif of the property
24
+ const base = {
25
+ remove: {
26
+ Float64: {
27
+ test: 5,
28
+ },
29
+ },
30
+ insert: {
31
+ String: {
32
+ test: "TestString",
33
+ },
34
+ },
35
+ };
36
+ const conflicts = [];
37
+ new changeset_1.ChangeSet(base)._rebaseChangeSet(modification, conflicts);
38
+ (0, chai_1.expect)(modification).to.be.empty;
39
+ });
40
+ it("modifications should stay unmodified for primitive collections in the case of a insert/remove", () => {
41
+ // Modification to a float property
42
+ const modification = {
43
+ modify: {
44
+ "map<Float64>": {
45
+ test: {
46
+ modify: {
47
+ entry: {
48
+ value: 10,
49
+ oldValue: 5,
50
+ },
51
+ },
52
+ },
53
+ },
54
+ },
55
+ };
56
+ // Base Changeset that changes the typeif of the property
57
+ const base = {
58
+ modify: {
59
+ "map<Float64>": {
60
+ test: {
61
+ remove: {
62
+ entry: 5,
63
+ },
64
+ insert: {
65
+ entry: 9,
66
+ },
67
+ },
68
+ },
69
+ },
70
+ };
71
+ let originalCS = (0, lodash_1.cloneDeep)(modification);
72
+ const conflicts = [];
73
+ new changeset_1.ChangeSet(base)._rebaseChangeSet(modification, conflicts);
74
+ (0, chai_1.expect)(modification).to.deep.equal(originalCS);
75
+ });
76
+ });
77
+ //# sourceMappingURL=indexedCollection.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexedCollection.spec.js","sourceRoot":"","sources":["../../src/test/indexedCollection.spec.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,+BAA8B;AAC9B,mCAAmC;AACnC,4CAAyC;AAEzC,QAAQ,CAAC,+BAA+B,EAAE;IACzC,EAAE,CAAC,sIAAsI,EAAE,GAAG,EAAE;QAC/I,mCAAmC;QACnC,MAAM,YAAY,GAAG;YACpB,MAAM,EAAE;gBACP,OAAO,EAAE;oBACR,IAAI,EAAE;wBACL,KAAK,EAAE,EAAE;wBACT,QAAQ,EAAE,CAAC;qBACX;iBACD;aACD;SACD,CAAC;QAEF,yDAAyD;QACzD,MAAM,IAAI,GAAG;YACZ,MAAM,EAAE;gBACP,OAAO,EAAE;oBACR,IAAI,EAAE,CAAC;iBACP;aACD;YACD,MAAM,EAAE;gBACP,MAAM,EAAE;oBACP,IAAI,EAAE,YAAY;iBAClB;aACD;SACD,CAAC;QAEF,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QAE9D,IAAA,aAAM,EAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+FAA+F,EAAE,GAAG,EAAE;QACxG,mCAAmC;QACnC,MAAM,YAAY,GAAG;YACpB,MAAM,EAAE;gBACP,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,MAAM,EAAE;4BACP,KAAK,EAAE;gCACN,KAAK,EAAE,EAAE;gCACT,QAAQ,EAAE,CAAC;6BACX;yBACD;qBACD;iBACD;aACD;SACD,CAAC;QAEF,yDAAyD;QACzD,MAAM,IAAI,GAAG;YACZ,MAAM,EAAE;gBACP,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,MAAM,EAAE;4BACP,KAAK,EAAE,CAAC;yBACR;wBACD,MAAM,EAAE;4BACP,KAAK,EAAE,CAAC;yBACR;qBACD;iBACD;aACD;SACD,CAAC;QAEF,IAAI,UAAU,GAAG,IAAA,kBAAS,EAAC,YAAY,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QAE9D,IAAA,aAAM,EAAC,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { expect } from \"chai\";\nimport { cloneDeep } from \"lodash\";\nimport { ChangeSet } from \"../changeset\";\n\ndescribe(\"Indexed Collection Operations\", function() {\n\tit(\"modifications should rebase to a NOP for polymorphic collection, when the type of a primitive property changes in the base ChangeSet\", () => {\n\t\t// Modification to a float property\n\t\tconst modification = {\n\t\t\tmodify: {\n\t\t\t\tFloat64: {\n\t\t\t\t\ttest: {\n\t\t\t\t\t\tvalue: 10,\n\t\t\t\t\t\toldValue: 5,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\t// Base Changeset that changes the typeif of the property\n\t\tconst base = {\n\t\t\tremove: {\n\t\t\t\tFloat64: {\n\t\t\t\t\ttest: 5,\n\t\t\t\t},\n\t\t\t},\n\t\t\tinsert: {\n\t\t\t\tString: {\n\t\t\t\t\ttest: \"TestString\",\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tconst conflicts = [];\n\t\tnew ChangeSet(base)._rebaseChangeSet(modification, conflicts);\n\n\t\texpect(modification).to.be.empty;\n\t});\n\n\tit(\"modifications should stay unmodified for primitive collections in the case of a insert/remove\", () => {\n\t\t// Modification to a float property\n\t\tconst modification = {\n\t\t\tmodify: {\n\t\t\t\t\"map<Float64>\": {\n\t\t\t\t\ttest: {\n\t\t\t\t\t\tmodify: {\n\t\t\t\t\t\t\tentry: {\n\t\t\t\t\t\t\t\tvalue: 10,\n\t\t\t\t\t\t\t\toldValue: 5,\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},\n\t\t\t},\n\t\t};\n\n\t\t// Base Changeset that changes the typeif of the property\n\t\tconst base = {\n\t\t\tmodify: {\n\t\t\t\t\"map<Float64>\": {\n\t\t\t\t\ttest: {\n\t\t\t\t\t\tremove: {\n\t\t\t\t\t\t\tentry: 5,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinsert: {\n\t\t\t\t\t\t\tentry: 9,\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\tlet originalCS = cloneDeep(modification);\n\t\tconst conflicts = [];\n\t\tnew ChangeSet(base)._rebaseChangeSet(modification, conflicts);\n\n\t\texpect(modification).to.deep.equal(originalCS);\n\t});\n});\n"]}
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../../../node_modules/@types/lodash/common/common.d.ts","../../../../../../node_modules/@types/lodash/common/array.d.ts","../../../../../../node_modules/@types/lodash/common/collection.d.ts","../../../../../../node_modules/@types/lodash/common/date.d.ts","../../../../../../node_modules/@types/lodash/common/function.d.ts","../../../../../../node_modules/@types/lodash/common/lang.d.ts","../../../../../../node_modules/@types/lodash/common/math.d.ts","../../../../../../node_modules/@types/lodash/common/number.d.ts","../../../../../../node_modules/@types/lodash/common/object.d.ts","../../../../../../node_modules/@types/lodash/common/seq.d.ts","../../../../../../node_modules/@types/lodash/common/string.d.ts","../../../../../../node_modules/@types/lodash/common/util.d.ts","../../../../../../node_modules/@types/lodash/index.d.ts","../../../../../../node_modules/@types/lodash/isEmpty.d.ts","../../../../../../node_modules/@types/lodash/isNumber.d.ts","../../../../../../node_modules/@types/lodash/range.d.ts","../changeset_operations/operationTypes.d.ts","../changeset_operations/arrayChangesetIterator.d.ts","../changeset_operations/array.d.ts","../changeset_operations/changesetConflictTypes.d.ts","../changeset_operations/indexedCollection.d.ts","../changeset.d.ts","../../src/test/array.spec.ts","../pathHelper.d.ts","../../src/test/pathHelper.spec.ts","../../src/test/reversibleCs.spec.ts","../validationResultBuilder.d.ts","../templateValidator.d.ts","../helpers/typeidHelper.d.ts","../../src/test/schemaValidator.ts","../../src/test/schemas/badBothPropertiesAndTypeid.ts","../../src/test/schemas/badInvalidSemverInTypeid.ts","../../src/test/schemas/badMissingSemverInTypeid.ts","../../src/test/schemas/badNestedProperties.ts","../../src/test/schemas/badPrimitiveTypeid.ts","../../src/test/schemas/badVersionedTypeid.ts","../../src/test/schemas/goodColorPalette.ts","../../src/test/schemas/goodDraftAsVersion.ts","../../src/test/schemas/goodPointId.ts","../../src/test/schemas/goodReferenceAndRegular.ts","../../src/test/schemas/goodReservedTypes.ts","../../src/test/schemas/goodUIBorder.ts","../../src/test/validator/templateSyntax.spec.ts","../../src/test/validator/templateValidator.spec.ts","../../src/test/validator/typeidHelper.spec.ts","../../../../../../node_modules/@types/node/assert.d.ts","../../../../../../node_modules/@types/node/globals.d.ts","../../../../../../node_modules/@types/node/async_hooks.d.ts","../../../../../../node_modules/@types/node/buffer.d.ts","../../../../../../node_modules/@types/events/index.d.ts","../../../../../../node_modules/@types/node/child_process.d.ts","../../../../../../node_modules/@types/node/cluster.d.ts","../../../../../../node_modules/@types/node/console.d.ts","../../../../../../node_modules/@types/node/constants.d.ts","../../../../../../node_modules/@types/node/crypto.d.ts","../../../../../../node_modules/@types/node/dgram.d.ts","../../../../../../node_modules/@types/node/dns.d.ts","../../../../../../node_modules/@types/node/domain.d.ts","../../../../../../node_modules/@types/node/events.d.ts","../../../../../../node_modules/@types/node/fs.d.ts","../../../../../../node_modules/@types/node/fs/promises.d.ts","../../../../../../node_modules/@types/node/http.d.ts","../../../../../../node_modules/@types/node/http2.d.ts","../../../../../../node_modules/@types/node/https.d.ts","../../../../../../node_modules/@types/node/inspector.d.ts","../../../../../../node_modules/@types/node/module.d.ts","../../../../../../node_modules/@types/node/net.d.ts","../../../../../../node_modules/@types/node/os.d.ts","../../../../../../node_modules/@types/node/path.d.ts","../../../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../../../node_modules/@types/node/process.d.ts","../../../../../../node_modules/@types/node/punycode.d.ts","../../../../../../node_modules/@types/node/querystring.d.ts","../../../../../../node_modules/@types/node/readline.d.ts","../../../../../../node_modules/@types/node/repl.d.ts","../../../../../../node_modules/@types/node/stream.d.ts","../../../../../../node_modules/@types/node/string_decoder.d.ts","../../../../../../node_modules/@types/node/timers.d.ts","../../../../../../node_modules/@types/node/tls.d.ts","../../../../../../node_modules/@types/node/trace_events.d.ts","../../../../../../node_modules/@types/node/tty.d.ts","../../../../../../node_modules/querystring/decode.d.ts","../../../../../../node_modules/querystring/encode.d.ts","../../../../../../node_modules/querystring/index.d.ts","../../../../../../node_modules/@types/node/url.d.ts","../../../../../../node_modules/@types/node/util.d.ts","../../../../../../node_modules/@types/node/v8.d.ts","../../../../../../node_modules/@types/node/vm.d.ts","../../../../../../node_modules/@types/node/wasi.d.ts","../../../../../../node_modules/@types/node/worker_threads.d.ts","../../../../../../node_modules/@types/node/zlib.d.ts","../../../../../../node_modules/@types/node/globals.global.d.ts","../../../../../../node_modules/@types/node/index.d.ts","../../../../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"927cb2b60048e1395b183bf74b2b80a75bdb1dbe384e1d9fac654313ea2fb136","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","ca59fe42b81228a317812e95a2e72ccc8c7f1911b5f0c2a032adf41a0161ec5d","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"8dcd8273655aef81be9c273e532a55f56032c7907b20f8ed4d069f7eec44ace8","e3602c7ef8cfedd027c02a023075b2c7ba2705d26ec521a8e95f2084f4a138ba","9b58c2cbd15e7c2c5ccd13f983fa2ef06c8c32724787b1f5bf1642129a0ac3c2","eae9ad23597af5ac54f91efac6486eacf994957236dcbf230ac67dab40023e5b","521e70241ef4038881395d05db810a4f0dd00b2071cb1955a0e7b284616170c6","27d1fd06fe7757c14d217eada132f52a56f75fb8e76f8e1772db909163ee6084","adfadc223af3b2425a1575f2196499bd2dd9375bb517f90bbc7b3a960c8905a2","305cf1f99469de544795593197fdfca38d734e4b4d2564ffe920b4f03305557e","177211fa955b396f2a477b9b3d067ccc8583de49d7dec5aae63d28bdbddb16e2","1fc1ebc0c389167ed5e851b50b2504dd510660a64e08eafedc6c104af894bf05","e767784c9d3ac35853ab4606c55167be0ca5235429641d375335523e0cdcb828","986d8abd8a5c1c819b3c3ac494d1198040b1745051411b165be96568e043fa86","e1fc7deb6dc38f55aa518a6807abb901fd222316ed035459c89a69c7c5413bda","5035d5bb6c487908736ff88714466b06256004ae99b15a455e8dec422fe29cd3","1840555ab8869b114e75f90fbaa38689769eb9f6e9f23b4b87c3a6547a120a0b","b08594f0655ff58c74cee26a7ca80e0cc640dc567c190f51a2cdda3db04b89fb","8e41c7bae6a18a80d9b2d3cffb278c32468519b4ecd5068d11ac66e39ec2863d",{"version":"a05c24245de393428c87d935f017f5eb413d828966b8d679d08236b4f6e4718d","affectsGlobalScope":true},{"version":"af0d4bd8f72a86fe127b70b450ad6da1f5e5a99d913ea69f34a4a60fe01e2ac1","affectsGlobalScope":true},{"version":"a5ace5338a1fcb53baf6ca79933b410292f02c4a5310f387b259ee388b3c515f","affectsGlobalScope":true},{"version":"23bd3e6d0ae175bf64d4663571f6e8d1eb7bb1689d22ac0767edddb7ccff2c35","affectsGlobalScope":true},{"version":"787a8b81ee1b603b8c171053d934416b4c6c7669ab2197b866a63ddc17aee047","affectsGlobalScope":true},{"version":"4d69f21bd866f6a542689c6e1001574978d94d513873c748a2fc57d655118023","affectsGlobalScope":true},{"version":"df48817c63cb5955ce0e1f21c57418aba1785eeaa35c4b8aadc7df3f4b83086f","affectsGlobalScope":true},{"version":"3179622a2e05a59e1104e7f28f1e407119b7c47d0c01e617f82790e4591fe592","affectsGlobalScope":true},{"version":"6a21fb3374bab4a2a807b8f1ab538488e71650ebf1370c45e533281d2f28b59c","affectsGlobalScope":true},{"version":"22a409fc6f9c0b55d0ff1146c8415125766b5dbe73bb23ff15ed9937e423a7c9","affectsGlobalScope":true},{"version":"f724101943b8cc1c96851b31ba4d95eeb8b82d578a0ae1702753c71d27263410","affectsGlobalScope":true},{"version":"8450fc871ee026acfe464e1b0a4b72acf66739131c44724131fb86c8e247c5ed","affectsGlobalScope":true},"e283cb1789771306cf1a0e98d1f854bc7bd50cc0c231664bb9a07a65ed769c6b","7968a169abfee9ed350365d3f80dd5343f08338a26f0eb1e845ad7655721f4ac","4bc3ad225f1f3321c19517b1c398dcb3b3eb79ab5a511588dc07b7fdffef738e","4c2c4f53e8eedd970f8afa369d7371544fb6231bf95e659f8602e09abe74d5a5",{"version":"dc5f6951bbf5b544349cbdef895c08dee6929818abd27d7d53c38cf1209091b3","affectsGlobalScope":true},"64e2803203b14d7f104f570f2152fde13abb6edc17b2ddb33d81ad86cf43d494","2c8d9e3331aec52d9a6d4040352c00282c3abaf48053ed0944528a4845c9caa3","400db42c3a46984118bff14260d60cec580057dc1ab4c2d7310beb643e4f5935","9b2a8f604e7c0482a9061755f00b287cc99bd8718dc82d8207dd74c599b6dc43","d0fc76a91c828fbe3f0be5d683273634b7b101068333ceed975a8a9ac464137b",{"version":"1a048ff164b8d9609f5de3139d4e37f6e8a82af82087ac414b9208f52ef8aac7","affectsGlobalScope":true},"3111079f3cb5f2b9c812ca3f46161562bce5bfb355e915f46ed46c41714dc1c3","64576aba4ff801004122056ccd049f0597aa471dcfd7670a6a0b877ee8dd97c0","b32b6b16cb0bda68199582ad6f22242d07ee75fac9b1f28a98cd838afc5eea45","4441ee4119824bfaebc49308559edd7545978f9cb41a40f115074e1031dde75f",{"version":"60693a88462d0e97900123b5bf7c73e146ce0cc94da46a61fe6775b430d2ff05","affectsGlobalScope":true},{"version":"588c69eda58b9202676ec7ca11a72c3762819b46a0ed72462c769846153c447c","affectsGlobalScope":true},"cc829932ffaf5c49092f878bec18af1fa5d8591b45a45e2b7f757f793cb3b4ed","47db10fdc4e76c4f4598cf7c91ba6bfde6cf6d8082c51860fe751643bf359739","05d7d95e24bc2897bf20ce041c3dc3cca814e07148a93999145b1a0ad491094c","d1080e49778c0b2ce656042ebfa43f89dffb96ac00f86a34762188a21857ffd4","0ce99c641ea20b0c0c09d093fc28f18f5ab31dc80033707a1ac3154399de2559","f0c33a0b325d3499cc9aded7d32886f998c9a27b465097c6cc136944d0aafdaa","44e42ed6ec9c4451ebe89524e80ac8564e9dd0988c56e6c58f393c810730595d","03c91e8833eef54dc44db99d7deb469b5e3cec82f23054b4286a2380e0e00996","1606ea615c0a5ea9f5c1376a33e34c0e1112e8dee31a5b3b8a74ce781893aa6f","9fef9de633d01cb7f01f68195626a890ededd25cf96a1e785617d08c8668230d","4455c78d226d061b1203c7614c6c6eb5f4f9db5f00d44ff47d0112de8766fbc4",{"version":"bf89ceb26132596b859cd4d129ce3f447134b444dec87966ba65cd7e8e9e0cb0","affectsGlobalScope":true},"4465a636f5f6e9665a90e30691862c9e0a3ac2edc0e66296704f10865e924f2a","9af781f03d44f5635ed7844be0ce370d9d595d4b4ec67cad88f0fac03255257e","f9fd4c3ef6de27fa0e256f4e75b61711c4be05a3399f7714621d3edc832e36b0","e49290b7a927995c0d7e6b2b9c8296284b68a9036d9966531de65185269258d7","a11d4ba43bf0825d7285d54dec6cb951685cd458a4de3c5c1800f7cbf7799009","874ca809b79276460011480a2829f4c8d4db29416dd411f71efbf8f497f0ac09","82e1723b20fa0b15a7da0d1a03fec88348f82f640f7a2f308d6c0fac780cfc7c","e0202c3e09775b86b902f21623e55896cea98750efbdf0691ca7473af06fe551","23a28f834a078986bbf58f4e3705956983ff81c3c2493f3db3e5f0e8a9507779","4febdf7f3ec92706c58e0b4e8159cd6de718284ef384260b07c9641c13fc70ce","ad7e61eca7f2f8bf47e72695f9f6663b75e41d87ef49abdb17c0cb843862f8aa","ecba2e44af95b0599c269a92628cec22e752868bce37396740deb51a5c547a26","46a9fb41a8f3bc7539eeebc15a6e04b9e55d7537a081615ad3614220d34c3e0f","a2666b43d889b4882ac6ede1c48128bac351886854e94f832b20d3730e5062c5","7335933d9f30dcfd2c4b6080a8b78e81912a7fcefb1dafccb67ca4cb4b3ac23d","a6bfe9de9adef749010c118104b071d14943802ff0614732b47ce4f1c3e383cd","4c3d0e10396646db4a1e917fb852077ee77ae62e512913bef9cccc2bb0f8bd0e","3b220849d58140dcc6718f5b52dcd29fdb79c45bc28f561cbd29eb1cac6cce13","0ee22fce41f7417a24c808d266e91b850629113c104713a35854393d55994beb","22d1b1d965baba05766613e2e6c753bb005d4386c448cafd72c309ba689e8c24",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"2a7d39ea70e483d3ebcde44031b6552940f295349bee8d486e8bdf6380162302",{"version":"3f6d6465811321abc30a1e5f667feed63e5b3917b3d6c8d6645daf96c75f97ba","affectsGlobalScope":true}],"options":{"declaration":false,"declarationMap":false,"esModuleInterop":true,"inlineSources":true,"module":1,"noImplicitAny":false,"noUnusedLocals":true,"outDir":"./","rootDir":"../../src/test","sourceMap":true,"strict":false,"target":4},"fileIdsList":[[48,49,50],[47,51],[46,51],[51],[56],[43,44,45,51],[53],[57,58],[59],[57,59],[58],[30,32,33,34,35,36,37,38,39,40,41,42],[30,31,33,34,35,36,37,38,39,40,41,42],[31,32,33,34,35,36,37,38,39,40,41,42],[30,31,32,34,35,36,37,38,39,40,41,42],[30,31,32,33,35,36,37,38,39,40,41,42],[30,31,32,33,34,36,37,38,39,40,41,42],[30,31,32,33,34,35,37,38,39,40,41,42],[30,31,32,33,34,35,36,38,39,40,41,42],[30,31,32,33,34,35,36,37,39,40,41,42],[30,31,32,33,34,35,36,37,38,40,41,42],[30,31,32,33,34,35,36,37,38,39,41,42],[30,31,32,33,34,35,36,37,38,39,40,42],[30,31,32,33,34,35,36,37,38,39,40,41],[42],[75],[77],[78],[80,88,89,96,105],[80,81,88,96],[82,115],[83,84,89,97],[84,105],[85,86,88,96],[86],[87,88],[88],[88,89,90,105,114],[89,90],[91,96,105,114],[88,89,91,92,96,105,108,114],[91,93,105,108,114],[75,76,77,78,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,114,115,116,117,118,119,120,121],[88,94],[95,114],[86,88,96,105],[97],[98],[77,99],[100,110],[101],[102],[88,103],[103,104,115,117],[88,105],[106],[107],[96,108],[109],[96,110],[102,114],[115],[105,116],[117],[118],[88,90,105,114,117,119],[105,120],[111,112]],"referencedMap":[[51,1],[48,2],[47,3],[50,4],[57,5],[52,6],[54,7],[55,4],[59,8],[72,9],[73,10],[74,11],[31,12],[32,13],[30,14],[33,15],[34,16],[35,17],[36,18],[37,19],[38,20],[39,21],[40,22],[41,23],[42,24],[43,25],[44,25],[45,25],[75,26],[77,27],[78,28],[80,29],[81,30],[82,31],[83,32],[84,33],[85,34],[86,35],[87,36],[88,37],[89,38],[90,39],[91,40],[92,41],[93,42],[122,43],[94,44],[95,45],[96,46],[97,47],[98,48],[99,49],[100,50],[101,51],[102,52],[103,53],[104,54],[105,55],[106,56],[107,57],[108,58],[109,59],[110,60],[114,61],[115,62],[116,63],[117,64],[118,65],[119,66],[120,67],[113,68]],"exportedModulesMap":[[51,1],[48,2],[47,3],[50,4],[57,5],[52,6],[54,7],[55,4],[59,8],[72,9],[73,10],[74,11],[31,12],[32,13],[30,14],[33,15],[34,16],[35,17],[36,18],[37,19],[38,20],[39,21],[40,22],[41,23],[42,24],[43,25],[44,25],[45,25],[75,26],[77,27],[78,28],[80,29],[81,30],[82,31],[83,32],[84,33],[85,34],[86,35],[87,36],[88,37],[89,38],[90,39],[91,40],[92,41],[93,42],[122,43],[94,44],[95,45],[96,46],[97,47],[98,48],[99,49],[100,50],[101,51],[102,52],[103,53],[104,54],[105,55],[106,56],[107,57],[108,58],[109,59],[110,60],[114,61],[115,62],[116,63],[117,64],[118,65],[119,66],[120,67],[113,68]],"semanticDiagnosticsPerFile":[51,48,47,49,50,46,58,53,57,56,52,54,55,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,79,31,32,30,33,34,35,36,37,38,39,40,41,42,43,44,45,123,75,77,78,80,81,82,83,84,85,86,87,88,89,90,76,121,91,92,93,122,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,114,115,116,117,118,119,120,111,112,113,6,7,9,8,2,10,11,12,13,14,15,16,17,3,4,21,18,19,20,22,23,24,5,25,26,27,28,1,29]},"version":"4.5.5"}
1
+ {"program":{"fileNames":["../../../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../../../node_modules/@types/lodash/common/common.d.ts","../../../../../../node_modules/@types/lodash/common/array.d.ts","../../../../../../node_modules/@types/lodash/common/collection.d.ts","../../../../../../node_modules/@types/lodash/common/date.d.ts","../../../../../../node_modules/@types/lodash/common/function.d.ts","../../../../../../node_modules/@types/lodash/common/lang.d.ts","../../../../../../node_modules/@types/lodash/common/math.d.ts","../../../../../../node_modules/@types/lodash/common/number.d.ts","../../../../../../node_modules/@types/lodash/common/object.d.ts","../../../../../../node_modules/@types/lodash/common/seq.d.ts","../../../../../../node_modules/@types/lodash/common/string.d.ts","../../../../../../node_modules/@types/lodash/common/util.d.ts","../../../../../../node_modules/@types/lodash/index.d.ts","../../../../../../node_modules/@types/lodash/isEmpty.d.ts","../../../../../../node_modules/@types/lodash/isNumber.d.ts","../../../../../../node_modules/@types/lodash/range.d.ts","../changeset_operations/operationTypes.d.ts","../changeset_operations/arrayChangesetIterator.d.ts","../changeset_operations/array.d.ts","../changeset_operations/changesetConflictTypes.d.ts","../changeset_operations/indexedCollection.d.ts","../changeset.d.ts","../../src/test/array.spec.ts","../../src/test/indexedCollection.spec.ts","../pathHelper.d.ts","../../src/test/pathHelper.spec.ts","../../src/test/reversibleCs.spec.ts","../validationResultBuilder.d.ts","../templateValidator.d.ts","../helpers/typeidHelper.d.ts","../../src/test/schemaValidator.ts","../../src/test/schemas/badBothPropertiesAndTypeid.ts","../../src/test/schemas/badInvalidSemverInTypeid.ts","../../src/test/schemas/badMissingSemverInTypeid.ts","../../src/test/schemas/badNestedProperties.ts","../../src/test/schemas/badPrimitiveTypeid.ts","../../src/test/schemas/badVersionedTypeid.ts","../../src/test/schemas/goodColorPalette.ts","../../src/test/schemas/goodDraftAsVersion.ts","../../src/test/schemas/goodPointId.ts","../../src/test/schemas/goodReferenceAndRegular.ts","../../src/test/schemas/goodReservedTypes.ts","../../src/test/schemas/goodUIBorder.ts","../../src/test/validator/templateSyntax.spec.ts","../../src/test/validator/templateValidator.spec.ts","../../src/test/validator/typeidHelper.spec.ts","../../../../../../node_modules/@types/node/assert.d.ts","../../../../../../node_modules/@types/node/globals.d.ts","../../../../../../node_modules/@types/node/async_hooks.d.ts","../../../../../../node_modules/@types/node/buffer.d.ts","../../../../../../node_modules/@types/events/index.d.ts","../../../../../../node_modules/@types/node/child_process.d.ts","../../../../../../node_modules/@types/node/cluster.d.ts","../../../../../../node_modules/@types/node/console.d.ts","../../../../../../node_modules/@types/node/constants.d.ts","../../../../../../node_modules/@types/node/crypto.d.ts","../../../../../../node_modules/@types/node/dgram.d.ts","../../../../../../node_modules/@types/node/dns.d.ts","../../../../../../node_modules/@types/node/domain.d.ts","../../../../../../node_modules/@types/node/events.d.ts","../../../../../../node_modules/@types/node/fs.d.ts","../../../../../../node_modules/@types/node/fs/promises.d.ts","../../../../../../node_modules/@types/node/http.d.ts","../../../../../../node_modules/@types/node/http2.d.ts","../../../../../../node_modules/@types/node/https.d.ts","../../../../../../node_modules/@types/node/inspector.d.ts","../../../../../../node_modules/@types/node/module.d.ts","../../../../../../node_modules/@types/node/net.d.ts","../../../../../../node_modules/@types/node/os.d.ts","../../../../../../node_modules/@types/node/path.d.ts","../../../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../../../node_modules/@types/node/process.d.ts","../../../../../../node_modules/@types/node/punycode.d.ts","../../../../../../node_modules/@types/node/querystring.d.ts","../../../../../../node_modules/@types/node/readline.d.ts","../../../../../../node_modules/@types/node/repl.d.ts","../../../../../../node_modules/@types/node/stream.d.ts","../../../../../../node_modules/@types/node/string_decoder.d.ts","../../../../../../node_modules/@types/node/timers.d.ts","../../../../../../node_modules/@types/node/tls.d.ts","../../../../../../node_modules/@types/node/trace_events.d.ts","../../../../../../node_modules/@types/node/tty.d.ts","../../../../../../node_modules/querystring/decode.d.ts","../../../../../../node_modules/querystring/encode.d.ts","../../../../../../node_modules/querystring/index.d.ts","../../../../../../node_modules/@types/node/url.d.ts","../../../../../../node_modules/@types/node/util.d.ts","../../../../../../node_modules/@types/node/v8.d.ts","../../../../../../node_modules/@types/node/vm.d.ts","../../../../../../node_modules/@types/node/wasi.d.ts","../../../../../../node_modules/@types/node/worker_threads.d.ts","../../../../../../node_modules/@types/node/zlib.d.ts","../../../../../../node_modules/@types/node/globals.global.d.ts","../../../../../../node_modules/@types/node/index.d.ts","../../../../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"927cb2b60048e1395b183bf74b2b80a75bdb1dbe384e1d9fac654313ea2fb136","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","ca59fe42b81228a317812e95a2e72ccc8c7f1911b5f0c2a032adf41a0161ec5d","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"8dcd8273655aef81be9c273e532a55f56032c7907b20f8ed4d069f7eec44ace8","e3602c7ef8cfedd027c02a023075b2c7ba2705d26ec521a8e95f2084f4a138ba","9b58c2cbd15e7c2c5ccd13f983fa2ef06c8c32724787b1f5bf1642129a0ac3c2","eae9ad23597af5ac54f91efac6486eacf994957236dcbf230ac67dab40023e5b","521e70241ef4038881395d05db810a4f0dd00b2071cb1955a0e7b284616170c6","27d1fd06fe7757c14d217eada132f52a56f75fb8e76f8e1772db909163ee6084","adfadc223af3b2425a1575f2196499bd2dd9375bb517f90bbc7b3a960c8905a2","305cf1f99469de544795593197fdfca38d734e4b4d2564ffe920b4f03305557e","177211fa955b396f2a477b9b3d067ccc8583de49d7dec5aae63d28bdbddb16e2","1fc1ebc0c389167ed5e851b50b2504dd510660a64e08eafedc6c104af894bf05","a6525e9fa98fdd33e2f569d524e7dda9cd8cfa32729084c8926129291d92c7f1","e767784c9d3ac35853ab4606c55167be0ca5235429641d375335523e0cdcb828","986d8abd8a5c1c819b3c3ac494d1198040b1745051411b165be96568e043fa86","e1fc7deb6dc38f55aa518a6807abb901fd222316ed035459c89a69c7c5413bda","5035d5bb6c487908736ff88714466b06256004ae99b15a455e8dec422fe29cd3","1840555ab8869b114e75f90fbaa38689769eb9f6e9f23b4b87c3a6547a120a0b","b08594f0655ff58c74cee26a7ca80e0cc640dc567c190f51a2cdda3db04b89fb","8e41c7bae6a18a80d9b2d3cffb278c32468519b4ecd5068d11ac66e39ec2863d",{"version":"a05c24245de393428c87d935f017f5eb413d828966b8d679d08236b4f6e4718d","affectsGlobalScope":true},{"version":"af0d4bd8f72a86fe127b70b450ad6da1f5e5a99d913ea69f34a4a60fe01e2ac1","affectsGlobalScope":true},{"version":"a5ace5338a1fcb53baf6ca79933b410292f02c4a5310f387b259ee388b3c515f","affectsGlobalScope":true},{"version":"23bd3e6d0ae175bf64d4663571f6e8d1eb7bb1689d22ac0767edddb7ccff2c35","affectsGlobalScope":true},{"version":"787a8b81ee1b603b8c171053d934416b4c6c7669ab2197b866a63ddc17aee047","affectsGlobalScope":true},{"version":"4d69f21bd866f6a542689c6e1001574978d94d513873c748a2fc57d655118023","affectsGlobalScope":true},{"version":"df48817c63cb5955ce0e1f21c57418aba1785eeaa35c4b8aadc7df3f4b83086f","affectsGlobalScope":true},{"version":"3179622a2e05a59e1104e7f28f1e407119b7c47d0c01e617f82790e4591fe592","affectsGlobalScope":true},{"version":"6a21fb3374bab4a2a807b8f1ab538488e71650ebf1370c45e533281d2f28b59c","affectsGlobalScope":true},{"version":"22a409fc6f9c0b55d0ff1146c8415125766b5dbe73bb23ff15ed9937e423a7c9","affectsGlobalScope":true},{"version":"f724101943b8cc1c96851b31ba4d95eeb8b82d578a0ae1702753c71d27263410","affectsGlobalScope":true},{"version":"8450fc871ee026acfe464e1b0a4b72acf66739131c44724131fb86c8e247c5ed","affectsGlobalScope":true},"e283cb1789771306cf1a0e98d1f854bc7bd50cc0c231664bb9a07a65ed769c6b","7968a169abfee9ed350365d3f80dd5343f08338a26f0eb1e845ad7655721f4ac","4bc3ad225f1f3321c19517b1c398dcb3b3eb79ab5a511588dc07b7fdffef738e","4c2c4f53e8eedd970f8afa369d7371544fb6231bf95e659f8602e09abe74d5a5",{"version":"dc5f6951bbf5b544349cbdef895c08dee6929818abd27d7d53c38cf1209091b3","affectsGlobalScope":true},"64e2803203b14d7f104f570f2152fde13abb6edc17b2ddb33d81ad86cf43d494","2c8d9e3331aec52d9a6d4040352c00282c3abaf48053ed0944528a4845c9caa3","400db42c3a46984118bff14260d60cec580057dc1ab4c2d7310beb643e4f5935","9b2a8f604e7c0482a9061755f00b287cc99bd8718dc82d8207dd74c599b6dc43","d0fc76a91c828fbe3f0be5d683273634b7b101068333ceed975a8a9ac464137b",{"version":"1a048ff164b8d9609f5de3139d4e37f6e8a82af82087ac414b9208f52ef8aac7","affectsGlobalScope":true},"3111079f3cb5f2b9c812ca3f46161562bce5bfb355e915f46ed46c41714dc1c3","64576aba4ff801004122056ccd049f0597aa471dcfd7670a6a0b877ee8dd97c0","b32b6b16cb0bda68199582ad6f22242d07ee75fac9b1f28a98cd838afc5eea45","4441ee4119824bfaebc49308559edd7545978f9cb41a40f115074e1031dde75f",{"version":"60693a88462d0e97900123b5bf7c73e146ce0cc94da46a61fe6775b430d2ff05","affectsGlobalScope":true},{"version":"588c69eda58b9202676ec7ca11a72c3762819b46a0ed72462c769846153c447c","affectsGlobalScope":true},"cc829932ffaf5c49092f878bec18af1fa5d8591b45a45e2b7f757f793cb3b4ed","47db10fdc4e76c4f4598cf7c91ba6bfde6cf6d8082c51860fe751643bf359739","05d7d95e24bc2897bf20ce041c3dc3cca814e07148a93999145b1a0ad491094c","d1080e49778c0b2ce656042ebfa43f89dffb96ac00f86a34762188a21857ffd4","0ce99c641ea20b0c0c09d093fc28f18f5ab31dc80033707a1ac3154399de2559","f0c33a0b325d3499cc9aded7d32886f998c9a27b465097c6cc136944d0aafdaa","44e42ed6ec9c4451ebe89524e80ac8564e9dd0988c56e6c58f393c810730595d","03c91e8833eef54dc44db99d7deb469b5e3cec82f23054b4286a2380e0e00996","1606ea615c0a5ea9f5c1376a33e34c0e1112e8dee31a5b3b8a74ce781893aa6f","9fef9de633d01cb7f01f68195626a890ededd25cf96a1e785617d08c8668230d","4455c78d226d061b1203c7614c6c6eb5f4f9db5f00d44ff47d0112de8766fbc4",{"version":"bf89ceb26132596b859cd4d129ce3f447134b444dec87966ba65cd7e8e9e0cb0","affectsGlobalScope":true},"4465a636f5f6e9665a90e30691862c9e0a3ac2edc0e66296704f10865e924f2a","9af781f03d44f5635ed7844be0ce370d9d595d4b4ec67cad88f0fac03255257e","f9fd4c3ef6de27fa0e256f4e75b61711c4be05a3399f7714621d3edc832e36b0","e49290b7a927995c0d7e6b2b9c8296284b68a9036d9966531de65185269258d7","a11d4ba43bf0825d7285d54dec6cb951685cd458a4de3c5c1800f7cbf7799009","874ca809b79276460011480a2829f4c8d4db29416dd411f71efbf8f497f0ac09","82e1723b20fa0b15a7da0d1a03fec88348f82f640f7a2f308d6c0fac780cfc7c","e0202c3e09775b86b902f21623e55896cea98750efbdf0691ca7473af06fe551","23a28f834a078986bbf58f4e3705956983ff81c3c2493f3db3e5f0e8a9507779","4febdf7f3ec92706c58e0b4e8159cd6de718284ef384260b07c9641c13fc70ce","ad7e61eca7f2f8bf47e72695f9f6663b75e41d87ef49abdb17c0cb843862f8aa","ecba2e44af95b0599c269a92628cec22e752868bce37396740deb51a5c547a26","46a9fb41a8f3bc7539eeebc15a6e04b9e55d7537a081615ad3614220d34c3e0f","a2666b43d889b4882ac6ede1c48128bac351886854e94f832b20d3730e5062c5","7335933d9f30dcfd2c4b6080a8b78e81912a7fcefb1dafccb67ca4cb4b3ac23d","a6bfe9de9adef749010c118104b071d14943802ff0614732b47ce4f1c3e383cd","4c3d0e10396646db4a1e917fb852077ee77ae62e512913bef9cccc2bb0f8bd0e","3b220849d58140dcc6718f5b52dcd29fdb79c45bc28f561cbd29eb1cac6cce13","0ee22fce41f7417a24c808d266e91b850629113c104713a35854393d55994beb","22d1b1d965baba05766613e2e6c753bb005d4386c448cafd72c309ba689e8c24",{"version":"2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1","affectsGlobalScope":true},"2a7d39ea70e483d3ebcde44031b6552940f295349bee8d486e8bdf6380162302",{"version":"3f6d6465811321abc30a1e5f667feed63e5b3917b3d6c8d6645daf96c75f97ba","affectsGlobalScope":true}],"options":{"declaration":false,"declarationMap":false,"esModuleInterop":true,"inlineSources":true,"module":1,"noImplicitAny":false,"noUnusedLocals":true,"outDir":"./","rootDir":"../../src/test","sourceMap":true,"strict":false,"target":4},"fileIdsList":[[48,49,50],[47,51],[46,51],[51],[57],[43,44,45,51],[42,51],[54],[58,59],[60],[58,60],[59],[30,32,33,34,35,36,37,38,39,40,41,42],[30,31,33,34,35,36,37,38,39,40,41,42],[31,32,33,34,35,36,37,38,39,40,41,42],[30,31,32,34,35,36,37,38,39,40,41,42],[30,31,32,33,35,36,37,38,39,40,41,42],[30,31,32,33,34,36,37,38,39,40,41,42],[30,31,32,33,34,35,37,38,39,40,41,42],[30,31,32,33,34,35,36,38,39,40,41,42],[30,31,32,33,34,35,36,37,39,40,41,42],[30,31,32,33,34,35,36,37,38,40,41,42],[30,31,32,33,34,35,36,37,38,39,41,42],[30,31,32,33,34,35,36,37,38,39,40,42],[30,31,32,33,34,35,36,37,38,39,40,41],[42],[76],[78],[79],[81,89,90,97,106],[81,82,89,97],[83,116],[84,85,90,98],[85,106],[86,87,89,97],[87],[88,89],[89],[89,90,91,106,115],[90,91],[92,97,106,115],[89,90,92,93,97,106,109,115],[92,94,106,109,115],[76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,115,116,117,118,119,120,121,122],[89,95],[96,115],[87,89,97,106],[98],[99],[78,100],[101,111],[102],[103],[89,104],[104,105,116,118],[89,106],[107],[108],[97,109],[110],[97,111],[103,115],[116],[106,117],[118],[119],[89,91,106,115,118,120],[106,121],[112,113]],"referencedMap":[[51,1],[48,2],[47,3],[50,4],[58,5],[52,6],[53,7],[55,8],[56,4],[60,9],[73,10],[74,11],[75,12],[31,13],[32,14],[30,15],[33,16],[34,17],[35,18],[36,19],[37,20],[38,21],[39,22],[40,23],[41,24],[42,25],[43,26],[44,26],[45,26],[76,27],[78,28],[79,29],[81,30],[82,31],[83,32],[84,33],[85,34],[86,35],[87,36],[88,37],[89,38],[90,39],[91,40],[92,41],[93,42],[94,43],[123,44],[95,45],[96,46],[97,47],[98,48],[99,49],[100,50],[101,51],[102,52],[103,53],[104,54],[105,55],[106,56],[107,57],[108,58],[109,59],[110,60],[111,61],[115,62],[116,63],[117,64],[118,65],[119,66],[120,67],[121,68],[114,69]],"exportedModulesMap":[[51,1],[48,2],[47,3],[50,4],[58,5],[52,6],[53,7],[55,8],[56,4],[60,9],[73,10],[74,11],[75,12],[31,13],[32,14],[30,15],[33,16],[34,17],[35,18],[36,19],[37,20],[38,21],[39,22],[40,23],[41,24],[42,25],[43,26],[44,26],[45,26],[76,27],[78,28],[79,29],[81,30],[82,31],[83,32],[84,33],[85,34],[86,35],[87,36],[88,37],[89,38],[90,39],[91,40],[92,41],[93,42],[94,43],[123,44],[95,45],[96,46],[97,47],[98,48],[99,49],[100,50],[101,51],[102,52],[103,53],[104,54],[105,55],[106,56],[107,57],[108,58],[109,59],[110,60],[111,61],[115,62],[116,63],[117,64],[118,65],[119,66],[120,67],[121,68],[114,69]],"semanticDiagnosticsPerFile":[51,48,47,49,50,46,59,54,58,57,52,53,55,56,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,80,31,32,30,33,34,35,36,37,38,39,40,41,42,43,44,45,124,76,78,79,81,82,83,84,85,86,87,88,89,90,91,77,122,92,93,94,123,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,115,116,117,118,119,120,121,112,113,114,6,7,9,8,2,10,11,12,13,14,15,16,17,3,4,21,18,19,20,22,23,24,5,25,26,27,28,1,29]},"version":"4.5.5"}
@@ -562,19 +562,21 @@ export var ChangeSetIndexedCollectionFunctions;
562
562
  delete modifyMap[key];
563
563
  }
564
564
  else if (modification.own === "remove_insert" && modification.other === "modify") {
565
- // We have a conflicting change. A node was removed and inserted (replaced) in the original
566
- // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification
567
- // can have been changed significantly by this operation, we don't know whether we can
568
- // apply the modification
569
- // Create the conflict information
570
- let conflict = {
571
- path: newPath,
572
- type: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,
573
- conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],
574
- };
575
- out_conflicts.push(conflict);
576
- // Delete the modification from the rebased ChangeSet
577
- delete io_rebasePropertyChangeSet.modify[key];
565
+ if (!isPrimitiveTypeid) {
566
+ // We have a conflicting change. A node was removed and inserted (replaced) in the original
567
+ // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification
568
+ // can have been changed significantly by this operation, we don't know whether we can
569
+ // apply the modification
570
+ // Create the conflict information
571
+ let conflict = {
572
+ path: newPath,
573
+ type: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,
574
+ conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],
575
+ };
576
+ out_conflicts.push(conflict);
577
+ // Delete the modification from the rebased ChangeSet
578
+ delete io_rebasePropertyChangeSet.modify[modification.otherTypeid][key];
579
+ }
578
580
  }
579
581
  else if ((modification.own === "modify" || modification.own === "remove") &&
580
582
  (modification.other === "remove" || modification.other === "remove_insert")) {
@@ -1 +1 @@
1
- {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEF,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAExC,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAEnD;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,kBAAkB,GAAG,UAAS,SAAc;IAC9C,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QAChE,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;KAC7B;IAED,wCAAwC;IACxC,KAAK,MAAM,MAAM,IAAI,SAAS,EAAE;QAC5B,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,KAAW,mCAAmC,CA+vBnD;AA/vBD,WAAiB,mCAAmC;IAChD;;;;;;;;;;;;;;OAcG;IACU,iFAA6C,GAAG,UACzD,sBAA2C,EAAE,iC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Q,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACxC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;wBAC3C,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;qBAClC;iBACJ;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACJ;SACJ;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACpC,OAAO,OAAO,CAAC,MAAM,CAAC;SACzB;IACL,CAAC,CAAC;AACN,CAAC,EA/vBgB,mCAAmC,KAAnC,mCAAmC,QA+vBnD","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\n import { copy as cloneDeep } from \"fastest-json-copy\";\n import isEmpty from \"lodash/isEmpty\";\n import isEqual from \"lodash/isEqual\";\n import isObject from \"lodash/isObject\";\n import without from \"lodash/without\";\n import 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 if (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n return isEmpty(in_object);\n }\n\n // eslint-disable-next-line guard-for-in\n for (const _entry in in_object) {\n return false;\n }\n\n return true;\n};\n\nexport namespace ChangeSetIndexedCollectionFunctions {\n /**\n * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n *\n * @param io_basePropertyChanges - The ChangeSet describing the initial state\n * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n * @param in_typeid - The typeid of the contents collection\n * (without the collection type)\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _performApplyAfterOnPropertyIndexedCollection = function(\n io_basePropertyChanges: SerializedChangeSet, // eslint-disable-line complexity\n in_appliedPropertyChanges: SerializedChangeSet,\n in_typeid: string,\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n // Handle remove entry operations\n if (in_appliedPropertyChanges.remove) {\n // Get and initialize the corresponding entries in the existing collection\n let removedEntries = in_appliedPropertyChanges.remove;\n\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.remove = io_basePropertyChanges.remove ||\n (Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n let baseInserted = io_basePropertyChanges.insert || {};\n let baseRemoved = io_basePropertyChanges.remove;\n let baseModified = io_basePropertyChanges.modify;\n let done = false;\n\n if (!Array.isArray(removedEntries)) {\n if (isPrimitiveTypeid) {\n removedEntries = Object.keys(removedEntries);\n } else {\n // this is a reversible change set of templated types\n const removedTypes = Object.keys(removedEntries);\n for (let t = 0; t < removedTypes.length; t++) {\n const removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n for (let i = 0; i < removedKeys.length; i++) {\n if (baseInserted[removedTypes[t]] &&\n baseInserted[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseInserted[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n delete baseInserted[removedTypes[t]];\n }\n } else {\n if (baseModified && baseModified[removedTypes[t]] &&\n baseModified[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseModified[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n delete baseModified[removedTypes[t]];\n }\n }\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(removedKeys[i]);\n } else {\n if (!baseRemoved[removedTypes[t]]) {\n baseRemoved[removedTypes[t]] = {};\n }\n baseRemoved[removedTypes[t]][removedKeys[i]] = removedEntries[removedTypes[t]][removedKeys[i]];\n }\n }\n }\n }\n done = true;\n }\n }\n\n if (!done) {\n if (isPrimitiveTypeid) {\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n\n // If there is an insert for this key, we just remove it\n if (baseInserted[key] !== undefined) {\n delete baseInserted[key];\n } else {\n // There could be a modify entry for this key, which we have to remove\n if (baseModified && baseModified[key] !== undefined) {\n delete baseModified[key];\n }\n\n // Otherwise we add it to the remove list\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(key);\n } else {\n baseRemoved[key] = in_appliedPropertyChanges.remove[key];\n }\n }\n }\n } else {\n const baseInsertedTypeids = Object.keys(baseInserted);\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n let foundInTypeid;\n\n // Since we only have a flat remove list (without typeid) in the changeset, we have\n // to check all inserts\n for (let j = 0; j < baseInsertedTypeids.length; j++) {\n if (baseInserted[baseInsertedTypeids[j]] &&\n baseInserted[baseInsertedTypeids[j]][key] !== undefined) {\n foundInTypeid = baseInsertedTypeids[j];\n break;\n }\n }\n\n if (foundInTypeid) {\n // If this key was inserted by this ChangeSet, we just remove it from the inserted list\n delete baseInserted[foundInTypeid][key];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted or modified section\n if (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n delete baseInserted[foundInTypeid];\n }\n if (baseModified && isEmpty(baseModified[foundInTypeid])) {\n delete baseModified[foundInTypeid];\n }\n } else {\n // There could be a modify entry for this key, which we have to remove\n const baseModifiedTypeids = Object.keys(baseModified || {});\n for (let j = 0; j < baseModifiedTypeids.length; j++) {\n if (baseModified[baseModifiedTypeids[j]][key]) {\n foundInTypeid = baseModifiedTypeids[j];\n delete baseModified[foundInTypeid][key];\n break;\n }\n }\n\n // Otherwise we add it to the remove list\n baseRemoved.push(key);\n }\n }\n }\n }\n }\n\n // Apply insert operations\n if (in_appliedPropertyChanges.insert) {\n // Get and initialize the corresponding entries from the existing collection\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n let baseInserted = io_basePropertyChanges.insert;\n let baseRemoved = io_basePropertyChanges.remove;\n\n // Insert the inserted entries\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const insertedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(in_appliedPropertyChanges.insert);\n for (let i = 0; i < insertedTypeids.length; i++) {\n let typeid = insertedTypeids[i];\n const insertedEntries = isPrimitiveTypeid ?\n in_appliedPropertyChanges.insert : in_appliedPropertyChanges.insert[typeid];\n const insertedKeys = Object.keys(insertedEntries);\n let removalCS;\n if (baseRemoved) {\n removalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n }\n for (let j = 0; j < insertedKeys.length; j++) {\n let key = insertedKeys[j];\n let deeplyEqualCS = false;\n\n // If we have a complex type in the collection, we need to do a deep comparison of the two\n // ChangeSets to determine, whether they are equal\n // TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n // Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n // the insert is reinserting exactly what was removed.\n if (!isPrimitiveTypeid && removalCS && isObject(removalCS) && removalCS[key] !== undefined) {\n // Split out the two parts: all the keys other than remove/insert should match exactly.\n // The contents 'remove' and 'insert', if they exist, should also match.\n deeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n // If there are 'insert' and 'remove', see if the removed data matches the inserted data\n if (deeplyEqualCS && insertedEntries[key].insert) {\n deeplyEqualCS = isEqual(\n insertedEntries[key].insert,\n removalCS[key].remove,\n );\n }\n\n // Finally, check if the data being inserted matches the data that was removed\n const insertedEntry = isObject(insertedEntries[key]) ? without(insertedEntries[key], \"insert\") : insertedEntries[key];\n const removedEntry = isObject(removalCS[key]) ? without(removalCS[key], \"remove\") : removalCS[key];\n deeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n }\n\n if ((isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n removalCS &&\n ((Array.isArray(removalCS) && includes(baseRemoved, key)) || removalCS[key] !== undefined)) {\n // A remove and insert are combined into a modify for primitive types\n\n // Remove the old remove command\n let oldValueMatches = false;\n if (Array.isArray(removalCS)) {\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n } else {\n io_basePropertyChanges.remove[typeid] = without(io_basePropertyChanges.remove[typeid], key);\n }\n } else {\n oldValueMatches = deeplyEqualCS || (removalCS[key] === insertedEntries[key]);\n delete removalCS[key];\n }\n\n // Insert a modify command instead\n if (!oldValueMatches) {\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.modify[key] = insertedEntries[key];\n } else {\n io_basePropertyChanges.modify[typeid] = io_basePropertyChanges.modify[typeid] || {};\n io_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n }\n }\n } else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n baseInserted[key] = insertedEntries[key];\n } else if (!isPrimitiveTypeid && (!baseInserted[typeid] || baseInserted[typeid][key] === undefined)) {\n baseInserted[typeid] = baseInserted[typeid] || {};\n baseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n } else {\n throw new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n }\n }\n }\n }\n\n // Handle modification operations\n if (in_appliedPropertyChanges.modify) {\n // Get and initialize the corresponding entries from the existing collection\n const modifiedEntries = in_appliedPropertyChanges.modify;\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n let baseModified = io_basePropertyChanges.modify;\n let baseInserted = io_basePropertyChanges.insert || {};\n\n // Process the modifications\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n for (let i = 0; i < modifiedTypeids.length; i++) {\n let typeid = modifiedTypeids[i];\n\n const modifyKeys = Object.keys(isPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid]);\n for (let j = 0; j < modifyKeys.length; j++) {\n let key = modifyKeys[j];\n\n if (isPrimitiveTypeid) {\n let newValue = modifiedEntries[key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = newValue.value;\n }\n if (baseInserted[key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n baseInserted[key] = newValue;\n } else {\n if (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n baseModified[key].value = newValue;\n } else {\n baseModified[key] = newValue;\n }\n }\n } else {\n // If this is a polymorphic collection, we can still have individual entries with\n // primitive types\n const isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n if (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n if (isEntryPrimitiveType && typeid !== \"String\") {\n let newValue = modifiedEntries[typeid][key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = modifiedEntries[typeid][key].value;\n }\n\n // In the case of Int64 or Uint64 we copy the array so that\n // both ChangeSets don't point to the same instance\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n newValue = newValue.slice();\n }\n\n if (baseInserted[typeid][key] && baseInserted[typeid][key].hasOwnProperty(\"value\")) {\n baseInserted[typeid][key].value = newValue;\n } else {\n baseInserted[typeid][key] = newValue;\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseInserted[typeid],\n modifiedEntries[typeid],\n typeid,\n false,\n in_options);\n }\n } else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n // If there was a previous modification operation, we have to merge the two\n if (isEntryPrimitiveType && typeid !== \"String\") {\n // Primitive types can simply be overwritten, however we have an exception for\n // 64 bit integers (until javascript natively supports them)\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n let appliedVal = modifiedEntries[typeid][key];\n if (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n appliedVal = appliedVal.value;\n }\n baseModified[typeid][key] = appliedVal.slice();\n } else {\n baseModified[typeid][key] = modifiedEntries[typeid][key];\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseModified[typeid],\n modifiedEntries[typeid],\n typeid,\n true,\n in_options);\n }\n } else {\n baseModified[typeid] = baseModified[typeid] || {};\n baseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n }\n }\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n };\n\n /**\n * Performs the rebase operation for set and map collections\n *\n * @param in_ownPropertyChangeSet - The ChangeSet for this collection\n * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased\n * @param in_basePath - Base path to get to the property processed by this function\n * @param in_typeid - The typeid of the contents collection (without the collection type)\n * @param in_useSquareBracketsInPath -\n * If set to true, paths will be created using the angular brackets syntax (for\n * arrays), otherwise dots will be used (for NodeProperties)\n * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _rebaseIndexedCollectionChangeSetForProperty = function(\n in_ownPropertyChangeSet: SerializedChangeSet, // eslint-disable-line complexity\n io_rebasePropertyChangeSet: SerializedChangeSet,\n in_basePath: string,\n in_typeid: string,\n in_useSquareBracketsInPath: boolean,\n out_conflicts: ConflictInfo[],\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n const changesByKeys = {};\n let modifyMap = {};\n // Helper function which stores the changes indexed by key in the changesByKeys array to\n // make it easier to compare the related changes in the two ChangeSets\n const addChanges = function(in_collection: Record<string, any>, in_changeIdentifier: string, in_changePrefix: string, in_typeidChange?: string) {\n // Collection didn't exist in this ChangeSet\n if (in_collection === undefined) {\n return;\n }\n\n // For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n // distinguish the two cases here\n const keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n // Add all entries indexed with the key\n for (let j = 0; j < keys.length; j++) {\n const key = keys[j];\n\n // Store the type of the change\n changesByKeys[key] = changesByKeys[key] || {};\n changesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix] ?\n `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}` :\n in_changeIdentifier;\n\n // If applicable store the typeid of the change\n if (in_typeidChange) {\n changesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n }\n\n // Store the ChangeSet\n if (in_changePrefix === \"other\") {\n if (!Array.isArray(in_collection)) {\n changesByKeys[key].change = in_collection[key];\n } else {\n changesByKeys[key].change = key;\n }\n }\n }\n };\n\n // Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n const addChangesWithTypeids = function(in_collection, in_changeIdentifier, in_changePrefix) {\n if (in_collection === undefined) {\n return;\n }\n // Iterate over the typeids (or use dummy entry for the iteration\n const addedKeyTypeids = Object.keys(in_collection);\n for (let i = 0; i < addedKeyTypeids.length; i++) {\n const Typeid = addedKeyTypeids[i];\n addChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n }\n };\n\n // Insert all changes from the ChangeSet into the lookup map\n if (Array.isArray(in_ownPropertyChangeSet.remove)) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n }\n }\n\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n addChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n }\n }\n\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n }\n\n // Check for modifications that affect the same object\n const changedKeys = Object.keys(changesByKeys);\n for (let i = 0; i < changedKeys.length; i++) {\n const key = changedKeys[i];\n const newPath = in_useSquareBracketsInPath ?\n `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]` :\n joinPaths(in_basePath, PathHelper.quotePathSegmentIfNeeded(key), PROPERTY_PATH_DELIMITER);\n\n const modification = changesByKeys[key];\n if (modification.own && modification.other) {\n /*\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 // A key was modified after it had been removed\n if (modification.own === \"modify\" && modification.other === \"modify\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid) && modification.ownTypeid !== \"String\")) {\n // We have two modification operations that affect the same entry for a base type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflict\n let ownModify = in_ownPropertyChangeSet.modify;\n let rebasedModify = io_rebasePropertyChangeSet.modify;\n if (modification.otherTypeid) {\n ownModify = ownModify[modification.otherTypeid];\n rebasedModify = rebasedModify[modification.otherTypeid];\n }\n\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: ownModify[key],\n };\n out_conflicts.push(conflict);\n // If value is the same, delete the entry\n let ownValue = ownModify[key];\n if (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n ownValue = ownValue.value;\n }\n let rebaseValue = rebasedModify[key];\n if (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n rebaseValue = rebaseValue.value;\n }\n if (modification.ownTypeid === \"Int64\" || modification.ownTypeid === \"Uint64\" || ownValue.length === 2) {\n // For (u)int64, values are arrays of 2 elements\n if (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n delete rebasedModify[key];\n }\n } else {\n if (ownValue === rebaseValue) {\n delete rebasedModify[key];\n }\n }\n } else {\n this.rebaseChangeSetForPropertyEntryWithTypeid(key,\n in_ownPropertyChangeSet.modify[modification.ownTypeid],\n io_rebasePropertyChangeSet.modify[modification.otherTypeid],\n modification.ownTypeid,\n newPath,\n true,\n out_conflicts,\n in_options);\n }\n } else if (modification.own === \"remove\" && modification.other === \"modify\") {\n modifyMap = modification.otherTypeid ? io_rebasePropertyChangeSet.modify[modification.otherTypeid] :\n io_rebasePropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete modifyMap[key];\n } else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\n // We have a conflicting change. A node was removed and inserted (replaced) in the original\n // ChangeSet and then modified by the rebased ChangeSet. Since the base of the modification\n // can have been changed significantly by this operation, we don't know whether we can\n // apply the modification\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT,\n conflictingChange: io_rebasePropertyChangeSet.modify[modification.otherTypeid][key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete io_rebasePropertyChangeSet.modify[key];\n } else if ((modification.own === \"modify\" || modification.own === \"remove\") &&\n (modification.other === \"remove\" || modification.other === \"remove_insert\")) {\n if (modification.own === \"modify\") {\n modifyMap = modification.ownTypeid ? in_ownPropertyChangeSet.modify[modification.ownTypeid] :\n in_ownPropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.REMOVE_AFTER_MODIFY,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n }\n\n // If we have a duplicated delete, we remove it from the new ChangeSet\n if (modification.own === \"remove\") {\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n io_rebasePropertyChangeSet.remove = without(io_rebasePropertyChangeSet.remove, key);\n } else {\n if (isPrimitiveTypeid) {\n delete io_rebasePropertyChangeSet.remove[key];\n } else {\n delete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n }\n }\n }\n } else if (modification.own === \"insert\" && modification.other === \"insert\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid))) {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // We have two insert operations that affect the same key for a primitive type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflicting set\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Convert to modify\n let oldValue;\n if (modification.otherTypeid) {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n modifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n oldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n } else {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n modifyMap = io_rebasePropertyChangeSet.modify;\n oldValue = in_ownPropertyChangeSet.insert[key];\n }\n\n modifyMap[key] = { value: insertMap[key], oldValue };\n delete insertMap[key];\n } else {\n // Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n // just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete insertMap[key];\n }\n } else if (modification.own === \"remove_insert\" && modification.other === \"remove_insert\") {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Raise the duplicate inserts as a conflict\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n } else {\n // All other operations are conflicting changes, which only occur for ChangeSets that are relative\n // to different bases\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INVALID_CHANGESET_BASE,\n conflictingChange: modification.change,\n };\n out_conflicts.push(conflict);\n\n // Remove the change from the ChangeSet\n if (modification.other !== \"remove\") {\n if (modification.otherTypeid !== undefined) {\n delete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][key];\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n } else {\n // Remove remove operations from the ChangeSet\n if (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n io_rebasePropertyChangeSet[modification.other] =\n without(io_rebasePropertyChangeSet[modification.other], key);\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n }\n\n console.error(\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\");\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n };\n\n /**\n * Removes empty entries from the .children collection of the ChangeSet\n *\n * @param in_propertyChanges - The ChangeSet to clean up\n * @param in_containsTypeids - Does this ChangeSet contain typeids\n * @private\n */\n export const _cleanIndexedCollectionChangeSet = function(in_propertyChanges: SerializedChangeSet, in_containsTypeids: boolean) {\n const changes = in_propertyChanges;\n // Clean inserts\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.insert || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n delete changes.insert[typeidList[j]];\n }\n }\n }\n\n // Remove add group if no operations are present\n if (_fastIsEmptyObject(changes.insert)) {\n delete changes.insert;\n }\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.remove || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n delete changes.remove[typeidList[j]];\n }\n }\n }\n // Remove remove group if no operations are present\n if (_fastIsEmptyObject(changes.remove)) {\n delete changes.remove;\n }\n\n // Clean modifies\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.modify || {});\n for (let j = 0; j < typeidList.length; j++) {\n const modifies = changes.modify[typeidList[j]];\n const modifyKeys = Object.keys(modifies);\n for (let k = 0; k < modifyKeys.length; k++) {\n if (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n delete modifies[modifyKeys[k]];\n }\n }\n if (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n delete changes.modify[typeidList[j]];\n }\n }\n }\n\n // Remove modify group if no operations are present\n if (_fastIsEmptyObject(changes.modify)) {\n delete changes.modify;\n }\n };\n}\n"]}
1
+ {"version":3,"file":"indexedCollection.js","sourceRoot":"","sources":["../../src/changeset_operations/indexedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEF,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAExC,aAAa;AACb,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAEnD;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,MAAM,kBAAkB,GAAG,UAAS,SAAc;IAC9C,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QAChE,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;KAC7B;IAED,wCAAwC;IACxC,KAAK,MAAM,MAAM,IAAI,SAAS,EAAE;QAC5B,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,KA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,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;YACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACxC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;wBAC3C,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;qBAClC;iBACJ;gBACD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACJ;SACJ;QAED,mDAAmD;QACnD,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACpC,OAAO,OAAO,CAAC,MAAM,CAAC;SACzB;IACL,CAAC,CAAC;AACN,CAAC,EAjwBgB,mCAAmC,KAAnC,mCAAmC,QAiwBnD","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\n import { copy as cloneDeep } from \"fastest-json-copy\";\n import isEmpty from \"lodash/isEmpty\";\n import isEqual from \"lodash/isEqual\";\n import isObject from \"lodash/isObject\";\n import without from \"lodash/without\";\n import 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 if (!in_object || Array.isArray(in_object) || !isObject(in_object)) {\n return isEmpty(in_object);\n }\n\n // eslint-disable-next-line guard-for-in\n for (const _entry in in_object) {\n return false;\n }\n\n return true;\n};\n\nexport namespace ChangeSetIndexedCollectionFunctions {\n /**\n * Applies a ChangeSet to a given indexed collection property (recursively). The ChangeSet is assumed to be relative\n * to the same property root and it will be applied behind the base ChangeSet (assuming that the changes are\n * relative to the state after the base ChangeSet has been applied. It will change the base ChangeSet.\n *\n * @param io_basePropertyChanges - The ChangeSet describing the initial state\n * @param in_appliedPropertyChanges - The ChangeSet to apply to this state\n * @param in_typeid - The typeid of the contents collection\n * (without the collection type)\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _performApplyAfterOnPropertyIndexedCollection = function(\n io_basePropertyChanges: SerializedChangeSet, // eslint-disable-line complexity\n in_appliedPropertyChanges: SerializedChangeSet,\n in_typeid: string,\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n // Handle remove entry operations\n if (in_appliedPropertyChanges.remove) {\n // Get and initialize the corresponding entries in the existing collection\n let removedEntries = in_appliedPropertyChanges.remove;\n\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.remove = io_basePropertyChanges.remove ||\n (Array.isArray(in_appliedPropertyChanges.remove) ? [] : {});\n let baseInserted = io_basePropertyChanges.insert || {};\n let baseRemoved = io_basePropertyChanges.remove;\n let baseModified = io_basePropertyChanges.modify;\n let done = false;\n\n if (!Array.isArray(removedEntries)) {\n if (isPrimitiveTypeid) {\n removedEntries = Object.keys(removedEntries);\n } else {\n // this is a reversible change set of templated types\n const removedTypes = Object.keys(removedEntries);\n for (let t = 0; t < removedTypes.length; t++) {\n const removedKeys = Object.keys(removedEntries[removedTypes[t]]);\n for (let i = 0; i < removedKeys.length; i++) {\n if (baseInserted[removedTypes[t]] &&\n baseInserted[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseInserted[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseInserted && isEmpty(baseInserted[removedTypes[t]])) {\n delete baseInserted[removedTypes[t]];\n }\n } else {\n if (baseModified && baseModified[removedTypes[t]] &&\n baseModified[removedTypes[t]][removedKeys[i]] !== undefined) {\n delete baseModified[removedTypes[t]][removedKeys[i]];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted section\n if (baseModified && isEmpty(baseModified[removedTypes[t]])) {\n delete baseModified[removedTypes[t]];\n }\n }\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(removedKeys[i]);\n } else {\n if (!baseRemoved[removedTypes[t]]) {\n baseRemoved[removedTypes[t]] = {};\n }\n baseRemoved[removedTypes[t]][removedKeys[i]] = removedEntries[removedTypes[t]][removedKeys[i]];\n }\n }\n }\n }\n done = true;\n }\n }\n\n if (!done) {\n if (isPrimitiveTypeid) {\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n\n // If there is an insert for this key, we just remove it\n if (baseInserted[key] !== undefined) {\n delete baseInserted[key];\n } else {\n // There could be a modify entry for this key, which we have to remove\n if (baseModified && baseModified[key] !== undefined) {\n delete baseModified[key];\n }\n\n // Otherwise we add it to the remove list\n if (Array.isArray(baseRemoved)) {\n baseRemoved.push(key);\n } else {\n baseRemoved[key] = in_appliedPropertyChanges.remove[key];\n }\n }\n }\n } else {\n const baseInsertedTypeids = Object.keys(baseInserted);\n for (let i = 0; i < removedEntries.length; i++) {\n let key = removedEntries[i];\n let foundInTypeid;\n\n // Since we only have a flat remove list (without typeid) in the changeset, we have\n // to check all inserts\n for (let j = 0; j < baseInsertedTypeids.length; j++) {\n if (baseInserted[baseInsertedTypeids[j]] &&\n baseInserted[baseInsertedTypeids[j]][key] !== undefined) {\n foundInTypeid = baseInsertedTypeids[j];\n break;\n }\n }\n\n if (foundInTypeid) {\n // If this key was inserted by this ChangeSet, we just remove it from the inserted list\n delete baseInserted[foundInTypeid][key];\n\n // If all entries for a typeid have been removed, we can remove\n // the whole typeid from the inserted or modified section\n if (baseInserted && isEmpty(baseInserted[foundInTypeid])) {\n delete baseInserted[foundInTypeid];\n }\n if (baseModified && isEmpty(baseModified[foundInTypeid])) {\n delete baseModified[foundInTypeid];\n }\n } else {\n // There could be a modify entry for this key, which we have to remove\n const baseModifiedTypeids = Object.keys(baseModified || {});\n for (let j = 0; j < baseModifiedTypeids.length; j++) {\n if (baseModified[baseModifiedTypeids[j]][key]) {\n foundInTypeid = baseModifiedTypeids[j];\n delete baseModified[foundInTypeid][key];\n break;\n }\n }\n\n // Otherwise we add it to the remove list\n baseRemoved.push(key);\n }\n }\n }\n }\n }\n\n // Apply insert operations\n if (in_appliedPropertyChanges.insert) {\n // Get and initialize the corresponding entries from the existing collection\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.insert = io_basePropertyChanges.insert || {};\n let baseInserted = io_basePropertyChanges.insert;\n let baseRemoved = io_basePropertyChanges.remove;\n\n // Insert the inserted entries\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const insertedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(in_appliedPropertyChanges.insert);\n for (let i = 0; i < insertedTypeids.length; i++) {\n let typeid = insertedTypeids[i];\n const insertedEntries = isPrimitiveTypeid ?\n in_appliedPropertyChanges.insert : in_appliedPropertyChanges.insert[typeid];\n const insertedKeys = Object.keys(insertedEntries);\n let removalCS;\n if (baseRemoved) {\n removalCS = isPrimitiveTypeid ? baseRemoved : baseRemoved[typeid];\n }\n for (let j = 0; j < insertedKeys.length; j++) {\n let key = insertedKeys[j];\n let deeplyEqualCS = false;\n\n // If we have a complex type in the collection, we need to do a deep comparison of the two\n // ChangeSets to determine, whether they are equal\n // TODO: We should actually compute a diff between the two and recursively convert portions to modifies\n // Instead, right now, we only handle the case where the two keys cancel each out perfectly, i.e.,\n // the insert is reinserting exactly what was removed.\n if (!isPrimitiveTypeid && removalCS && isObject(removalCS) && removalCS[key] !== undefined) {\n // Split out the two parts: all the keys other than remove/insert should match exactly.\n // The contents 'remove' and 'insert', if they exist, should also match.\n deeplyEqualCS = !!insertedEntries[key].insert === !!removalCS[key].remove;\n\n // If there are 'insert' and 'remove', see if the removed data matches the inserted data\n if (deeplyEqualCS && insertedEntries[key].insert) {\n deeplyEqualCS = isEqual(\n insertedEntries[key].insert,\n removalCS[key].remove,\n );\n }\n\n // Finally, check if the data being inserted matches the data that was removed\n const insertedEntry = isObject(insertedEntries[key]) ? without(insertedEntries[key], \"insert\") : insertedEntries[key];\n const removedEntry = isObject(removalCS[key]) ? without(removalCS[key], \"remove\") : removalCS[key];\n deeplyEqualCS = deeplyEqualCS && isEqual(insertedEntry, removedEntry);\n }\n\n if ((isPrimitiveTypeid || TypeIdHelper.isPrimitiveType(typeid) || deeplyEqualCS) &&\n removalCS &&\n ((Array.isArray(removalCS) && includes(baseRemoved, key)) || removalCS[key] !== undefined)) {\n // A remove and insert are combined into a modify for primitive types\n\n // Remove the old remove command\n let oldValueMatches = false;\n if (Array.isArray(removalCS)) {\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.remove = without(io_basePropertyChanges.remove, key);\n } else {\n io_basePropertyChanges.remove[typeid] = without(io_basePropertyChanges.remove[typeid], key);\n }\n } else {\n oldValueMatches = deeplyEqualCS || (removalCS[key] === insertedEntries[key]);\n delete removalCS[key];\n }\n\n // Insert a modify command instead\n if (!oldValueMatches) {\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n if (isPrimitiveTypeid) {\n io_basePropertyChanges.modify[key] = insertedEntries[key];\n } else {\n io_basePropertyChanges.modify[typeid] = io_basePropertyChanges.modify[typeid] || {};\n io_basePropertyChanges.modify[typeid][key] = cloneDeep(insertedEntries[key]);\n }\n }\n } else if (isPrimitiveTypeid && baseInserted[key] === undefined) {\n baseInserted[key] = insertedEntries[key];\n } else if (!isPrimitiveTypeid && (!baseInserted[typeid] || baseInserted[typeid][key] === undefined)) {\n baseInserted[typeid] = baseInserted[typeid] || {};\n baseInserted[typeid][key] = cloneDeep(insertedEntries[key]);\n } else {\n throw new Error(MSG.ALREADY_EXISTING_ENTRY + key);\n }\n }\n }\n }\n\n // Handle modification operations\n if (in_appliedPropertyChanges.modify) {\n // Get and initialize the corresponding entries from the existing collection\n const modifiedEntries = in_appliedPropertyChanges.modify;\n io_basePropertyChanges = io_basePropertyChanges || {};\n io_basePropertyChanges.modify = io_basePropertyChanges.modify || {};\n let baseModified = io_basePropertyChanges.modify;\n let baseInserted = io_basePropertyChanges.insert || {};\n\n // Process the modifications\n\n // If no typeids are included, we just use a placeholder for the iteration below\n const modifiedTypeids = isPrimitiveTypeid ? [undefined] : Object.keys(modifiedEntries);\n for (let i = 0; i < modifiedTypeids.length; i++) {\n let typeid = modifiedTypeids[i];\n\n const modifyKeys = Object.keys(isPrimitiveTypeid ? modifiedEntries : modifiedEntries[typeid]);\n for (let j = 0; j < modifyKeys.length; j++) {\n let key = modifyKeys[j];\n\n if (isPrimitiveTypeid) {\n let newValue = modifiedEntries[key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = newValue.value;\n }\n if (baseInserted[key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n baseInserted[key] = newValue;\n } else {\n if (baseModified[key] && baseModified[key].hasOwnProperty(\"value\")) {\n baseModified[key].value = newValue;\n } else {\n baseModified[key] = newValue;\n }\n }\n } else {\n // If this is a polymorphic collection, we can still have individual entries with\n // primitive types\n const isEntryPrimitiveType = TypeIdHelper.isPrimitiveType(typeid);\n\n if (baseInserted[typeid] && baseInserted[typeid][key] !== undefined) {\n // If this entry was added by this ChangeSet, we modify the insert operation according to the\n // new ChangeSet\n if (isEntryPrimitiveType && typeid !== \"String\") {\n let newValue = modifiedEntries[typeid][key];\n if (newValue && newValue.hasOwnProperty(\"value\")) {\n newValue = modifiedEntries[typeid][key].value;\n }\n\n // In the case of Int64 or Uint64 we copy the array so that\n // both ChangeSets don't point to the same instance\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n newValue = newValue.slice();\n }\n\n if (baseInserted[typeid][key] && baseInserted[typeid][key].hasOwnProperty(\"value\")) {\n baseInserted[typeid][key].value = newValue;\n } else {\n baseInserted[typeid][key] = newValue;\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseInserted[typeid],\n modifiedEntries[typeid],\n typeid,\n false,\n in_options);\n }\n } else if (baseModified[typeid] && baseModified[typeid][key] !== undefined) {\n // If there was a previous modification operation, we have to merge the two\n if (isEntryPrimitiveType && typeid !== \"String\") {\n // Primitive types can simply be overwritten, however we have an exception for\n // 64 bit integers (until javascript natively supports them)\n if (typeid === \"Int64\" || typeid === \"Uint64\") {\n let appliedVal = modifiedEntries[typeid][key];\n if (appliedVal && appliedVal.hasOwnProperty(\"value\")) {\n appliedVal = appliedVal.value;\n }\n baseModified[typeid][key] = appliedVal.slice();\n } else {\n baseModified[typeid][key] = modifiedEntries[typeid][key];\n }\n } else {\n this.performApplyAfterOnPropertyWithTypeid(key,\n baseModified[typeid],\n modifiedEntries[typeid],\n typeid,\n true,\n in_options);\n }\n } else {\n baseModified[typeid] = baseModified[typeid] || {};\n baseModified[typeid][key] = cloneDeep(modifiedEntries[typeid][key]);\n }\n }\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_basePropertyChanges, !isPrimitiveTypeid);\n };\n\n /**\n * Performs the rebase operation for set and map collections\n *\n * @param in_ownPropertyChangeSet - The ChangeSet for this collection\n * @param io_rebasePropertyChangeSet - The ChangeSet for the collection to be rebased\n * @param in_basePath - Base path to get to the property processed by this function\n * @param in_typeid - The typeid of the contents collection (without the collection type)\n * @param in_useSquareBracketsInPath -\n * If set to true, paths will be created using the angular brackets syntax (for\n * arrays), otherwise dots will be used (for NodeProperties)\n * @param out_conflicts - A list of paths that resulted in conflicts together with the type of the conflict\n * @param in_options - Optional additional parameters\n * @param in_options.applyAfterMetaInformation - Additional meta information which help later to obtain\n * more compact changeset during the apply operation\n *\n * @private\n */\n export const _rebaseIndexedCollectionChangeSetForProperty = function(\n in_ownPropertyChangeSet: SerializedChangeSet, // eslint-disable-line complexity\n io_rebasePropertyChangeSet: SerializedChangeSet,\n in_basePath: string,\n in_typeid: string,\n in_useSquareBracketsInPath: boolean,\n out_conflicts: ConflictInfo[],\n in_options: ApplyChangeSetOptions) {\n const isPrimitiveTypeid = TypeIdHelper.isPrimitiveType(in_typeid);\n\n const changesByKeys = {};\n let modifyMap = {};\n // Helper function which stores the changes indexed by key in the changesByKeys array to\n // make it easier to compare the related changes in the two ChangeSets\n const addChanges = function(in_collection: Record<string, any>, in_changeIdentifier: string, in_changePrefix: string, in_typeidChange?: string) {\n // Collection didn't exist in this ChangeSet\n if (in_collection === undefined) {\n return;\n }\n\n // For remove operations, the ChangeSet is only an array of keys, otherwise it is a map, so we have to\n // distinguish the two cases here\n const keys = Array.isArray(in_collection) ? in_collection : Object.keys(in_collection);\n\n // Add all entries indexed with the key\n for (let j = 0; j < keys.length; j++) {\n const key = keys[j];\n\n // Store the type of the change\n changesByKeys[key] = changesByKeys[key] || {};\n changesByKeys[key][in_changePrefix] = changesByKeys[key][in_changePrefix] ?\n `${changesByKeys[key][in_changePrefix]}_${in_changeIdentifier}` :\n in_changeIdentifier;\n\n // If applicable store the typeid of the change\n if (in_typeidChange) {\n changesByKeys[key][`${in_changePrefix}Typeid`] = in_typeidChange;\n }\n\n // Store the ChangeSet\n if (in_changePrefix === \"other\") {\n if (!Array.isArray(in_collection)) {\n changesByKeys[key].change = in_collection[key];\n } else {\n changesByKeys[key].change = key;\n }\n }\n }\n };\n\n // Helper function which adds the Changes for a ChangeSet that is ordered by typeid\n const addChangesWithTypeids = function(in_collection, in_changeIdentifier, in_changePrefix) {\n if (in_collection === undefined) {\n return;\n }\n // Iterate over the typeids (or use dummy entry for the iteration\n const addedKeyTypeids = Object.keys(in_collection);\n for (let i = 0; i < addedKeyTypeids.length; i++) {\n const Typeid = addedKeyTypeids[i];\n addChanges(in_collection[Typeid], in_changeIdentifier, in_changePrefix, Typeid);\n }\n };\n\n // Insert all changes from the ChangeSet into the lookup map\n if (Array.isArray(in_ownPropertyChangeSet.remove)) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.remove, \"remove\", \"own\");\n }\n }\n\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n if (isPrimitiveTypeid) {\n addChanges(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n } else {\n addChangesWithTypeids(io_rebasePropertyChangeSet.remove, \"remove\", \"other\");\n }\n }\n\n if (isPrimitiveTypeid) {\n addChanges(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChanges(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChanges(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChanges(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n } else {\n addChangesWithTypeids(in_ownPropertyChangeSet.insert, \"insert\", \"own\");\n addChangesWithTypeids(in_ownPropertyChangeSet.modify, \"modify\", \"own\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.insert, \"insert\", \"other\");\n addChangesWithTypeids(io_rebasePropertyChangeSet.modify, \"modify\", \"other\");\n }\n\n // Check for modifications that affect the same object\n const changedKeys = Object.keys(changesByKeys);\n for (let i = 0; i < changedKeys.length; i++) {\n const key = changedKeys[i];\n const newPath = in_useSquareBracketsInPath ?\n `${in_basePath}[${PathHelper.quotePathSegmentIfNeeded(key)}]` :\n joinPaths(in_basePath, PathHelper.quotePathSegmentIfNeeded(key), PROPERTY_PATH_DELIMITER);\n\n const modification = changesByKeys[key];\n if (modification.own && modification.other) {\n /*\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 // A key was modified after it had been removed\n if (modification.own === \"modify\" && modification.other === \"modify\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid) && modification.ownTypeid !== \"String\")) {\n // We have two modification operations that affect the same entry for a base type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflict\n let ownModify = in_ownPropertyChangeSet.modify;\n let rebasedModify = io_rebasePropertyChangeSet.modify;\n if (modification.otherTypeid) {\n ownModify = ownModify[modification.otherTypeid];\n rebasedModify = rebasedModify[modification.otherTypeid];\n }\n\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: ownModify[key],\n };\n out_conflicts.push(conflict);\n // If value is the same, delete the entry\n let ownValue = ownModify[key];\n if (typeof ownValue === \"object\" && ownValue.hasOwnProperty(\"value\")) {\n ownValue = ownValue.value;\n }\n let rebaseValue = rebasedModify[key];\n if (typeof rebaseValue === \"object\" && rebaseValue.hasOwnProperty(\"value\")) {\n rebaseValue = rebaseValue.value;\n }\n if (modification.ownTypeid === \"Int64\" || modification.ownTypeid === \"Uint64\" || ownValue.length === 2) {\n // For (u)int64, values are arrays of 2 elements\n if (ownValue[0] === rebaseValue[0] && ownValue[1] === rebaseValue[1]) {\n delete rebasedModify[key];\n }\n } else {\n if (ownValue === rebaseValue) {\n delete rebasedModify[key];\n }\n }\n } else {\n this.rebaseChangeSetForPropertyEntryWithTypeid(key,\n in_ownPropertyChangeSet.modify[modification.ownTypeid],\n io_rebasePropertyChangeSet.modify[modification.otherTypeid],\n modification.ownTypeid,\n newPath,\n true,\n out_conflicts,\n in_options);\n }\n } else if (modification.own === \"remove\" && modification.other === \"modify\") {\n modifyMap = modification.otherTypeid ? io_rebasePropertyChangeSet.modify[modification.otherTypeid] :\n io_rebasePropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.ENTRY_MODIFIED_AFTER_REMOVE,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete modifyMap[key];\n } else if (modification.own === \"remove_insert\" && modification.other === \"modify\") {\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 conflictingChange: io_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 } else if ((modification.own === \"modify\" || modification.own === \"remove\") &&\n (modification.other === \"remove\" || modification.other === \"remove_insert\")) {\n if (modification.own === \"modify\") {\n modifyMap = modification.ownTypeid ? in_ownPropertyChangeSet.modify[modification.ownTypeid] :\n in_ownPropertyChangeSet.modify;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.REMOVE_AFTER_MODIFY,\n conflictingChange: modifyMap[key],\n };\n out_conflicts.push(conflict);\n }\n\n // If we have a duplicated delete, we remove it from the new ChangeSet\n if (modification.own === \"remove\") {\n if (Array.isArray(io_rebasePropertyChangeSet.remove)) {\n io_rebasePropertyChangeSet.remove = without(io_rebasePropertyChangeSet.remove, key);\n } else {\n if (isPrimitiveTypeid) {\n delete io_rebasePropertyChangeSet.remove[key];\n } else {\n delete io_rebasePropertyChangeSet.remove[modification.otherTypeid][key];\n }\n }\n }\n } else if (modification.own === \"insert\" && modification.other === \"insert\") {\n if (isPrimitiveTypeid ||\n (TypeIdHelper.isPrimitiveType(modification.ownTypeid))) {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // We have two insert operations that affect the same key for a primitive type.\n // This is a legal operation, the second one will overwrite the first one, but we\n // report it as a possible conflicting set\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Convert to modify\n let oldValue;\n if (modification.otherTypeid) {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] =\n io_rebasePropertyChangeSet.modify[modification.otherTypeid] || {};\n modifyMap = io_rebasePropertyChangeSet.modify[modification.otherTypeid];\n oldValue = in_ownPropertyChangeSet.insert[modification.ownTypeid][key];\n } else {\n io_rebasePropertyChangeSet.modify = io_rebasePropertyChangeSet.modify || {};\n modifyMap = io_rebasePropertyChangeSet.modify;\n oldValue = in_ownPropertyChangeSet.insert[key];\n }\n\n modifyMap[key] = { value: insertMap[key], oldValue };\n delete insertMap[key];\n } else {\n // Here we have two insert operations for objects. Since these affect a whole sub-tree and not\n // just a single value, we cannot easily convert it into a modify and instead report it as invalid\n\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INSERTED_ENTRY_WITH_SAME_KEY,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n\n // Delete the modification from the rebased ChangeSet\n delete insertMap[key];\n }\n } else if (modification.own === \"remove_insert\" && modification.other === \"remove_insert\") {\n let insertMap = modification.otherTypeid ? io_rebasePropertyChangeSet.insert[modification.otherTypeid] :\n io_rebasePropertyChangeSet.insert;\n\n // Raise the duplicate inserts as a conflict\n let conflict = {\n path: newPath,\n type: ConflictType.COLLIDING_SET,\n conflictingChange: insertMap[key],\n };\n out_conflicts.push(conflict);\n } else {\n // All other operations are conflicting changes, which only occur for ChangeSets that are relative\n // to different bases\n\n // Create the conflict information\n let conflict = {\n path: newPath,\n type: ConflictType.INVALID_CHANGESET_BASE,\n conflictingChange: modification.change,\n };\n out_conflicts.push(conflict);\n\n // Remove the change from the ChangeSet\n if (modification.other !== \"remove\") {\n if (modification.otherTypeid !== undefined) {\n delete io_rebasePropertyChangeSet[modification.other][modification.otherTypeid][key];\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n } else {\n // Remove remove operations from the ChangeSet\n if (Array.isArray(io_rebasePropertyChangeSet[modification.other])) {\n io_rebasePropertyChangeSet[modification.other] =\n without(io_rebasePropertyChangeSet[modification.other], key);\n } else {\n delete io_rebasePropertyChangeSet[modification.other][key];\n }\n }\n\n console.error(\"Rebase operation with conflicting ChangeSets. Probably incorrect bases.\");\n }\n }\n }\n\n // Remove unnecessary entries from the ChangeSet\n this._cleanIndexedCollectionChangeSet(io_rebasePropertyChangeSet, !isPrimitiveTypeid);\n };\n\n /**\n * Removes empty entries from the .children collection of the ChangeSet\n *\n * @param in_propertyChanges - The ChangeSet to clean up\n * @param in_containsTypeids - Does this ChangeSet contain typeids\n * @private\n */\n export const _cleanIndexedCollectionChangeSet = function(in_propertyChanges: SerializedChangeSet, in_containsTypeids: boolean) {\n const changes = in_propertyChanges;\n // Clean inserts\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.insert || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.insert[typeidList[j]])) {\n delete changes.insert[typeidList[j]];\n }\n }\n }\n\n // Remove add group if no operations are present\n if (_fastIsEmptyObject(changes.insert)) {\n delete changes.insert;\n }\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.remove || {});\n for (let j = 0; j < typeidList.length; j++) {\n if (_fastIsEmptyObject(changes.remove[typeidList[j]])) {\n delete changes.remove[typeidList[j]];\n }\n }\n }\n // Remove remove group if no operations are present\n if (_fastIsEmptyObject(changes.remove)) {\n delete changes.remove;\n }\n\n // Clean modifies\n\n // First remove unused typeid sections\n if (in_containsTypeids) {\n let typeidList = Object.keys(changes.modify || {});\n for (let j = 0; j < typeidList.length; j++) {\n const modifies = changes.modify[typeidList[j]];\n const modifyKeys = Object.keys(modifies);\n for (let k = 0; k < modifyKeys.length; k++) {\n if (isEmptyChangeSet(modifies[modifyKeys[k]])) {\n delete modifies[modifyKeys[k]];\n }\n }\n if (_fastIsEmptyObject(changes.modify[typeidList[j]])) {\n delete changes.modify[typeidList[j]];\n }\n }\n }\n\n // Remove modify group if no operations are present\n if (_fastIsEmptyObject(changes.modify)) {\n delete changes.modify;\n }\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/property-changeset",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "property changeset definitions and related functionalities",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -61,7 +61,7 @@
61
61
  "temp-directory": "nyc/.nyc_output"
62
62
  },
63
63
  "dependencies": {
64
- "@fluid-experimental/property-common": "^1.3.5",
64
+ "@fluid-experimental/property-common": "^1.3.7",
65
65
  "ajv": "7.1.1",
66
66
  "ajv-keywords": "4.0.0",
67
67
  "async": "^3.2.0",
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "devDependencies": {
74
74
  "@fluidframework/build-common": "^0.24.0",
75
- "@fluidframework/mocha-test-setup": "^1.3.5",
75
+ "@fluidframework/mocha-test-setup": "^1.3.7",
76
76
  "@rushstack/eslint-config": "^2.5.1",
77
77
  "@types/lodash": "^4.14.118",
78
78
  "@types/mocha": "^9.1.1",