@fluid-experimental/property-changeset 2.0.0-internal.1.2.0.93071 → 2.0.0-internal.1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/changeset.d.ts.map +1 -1
  2. package/dist/changeset.js +3 -6
  3. package/dist/changeset.js.map +1 -1
  4. package/dist/changeset_operations/array.d.ts +31 -0
  5. package/dist/changeset_operations/array.d.ts.map +1 -1
  6. package/dist/changeset_operations/array.js +52 -47
  7. package/dist/changeset_operations/array.js.map +1 -1
  8. package/dist/changeset_operations/indexedCollection.d.ts +12 -14
  9. package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
  10. package/dist/changeset_operations/indexedCollection.js +13 -14
  11. package/dist/changeset_operations/indexedCollection.js.map +1 -1
  12. package/dist/helpers/typeidHelper.d.ts +6 -6
  13. package/dist/helpers/typeidHelper.d.ts.map +1 -1
  14. package/dist/helpers/typeidHelper.js +16 -26
  15. package/dist/helpers/typeidHelper.js.map +1 -1
  16. package/dist/pathHelper.d.ts +1 -1
  17. package/dist/pathHelper.d.ts.map +1 -1
  18. package/dist/pathHelper.js +50 -52
  19. package/dist/pathHelper.js.map +1 -1
  20. package/dist/templateValidator.d.ts +58 -26
  21. package/dist/templateValidator.d.ts.map +1 -1
  22. package/dist/templateValidator.js +64 -38
  23. package/dist/templateValidator.js.map +1 -1
  24. package/dist/test/array.spec.js +3 -6
  25. package/dist/test/array.spec.js.map +1 -1
  26. package/dist/test/pathHelper.spec.js +2 -4
  27. package/dist/test/pathHelper.spec.js.map +1 -1
  28. package/dist/test/reversibleCs.spec.js +2 -4
  29. package/dist/test/reversibleCs.spec.js.map +1 -1
  30. package/dist/test/tsconfig.tsbuildinfo +1 -1
  31. package/dist/test/validator/templateValidator.spec.js +5 -10
  32. package/dist/test/validator/templateValidator.spec.js.map +1 -1
  33. package/dist/utils.d.ts +131 -103
  34. package/dist/utils.d.ts.map +1 -1
  35. package/dist/utils.js +160 -167
  36. package/dist/utils.js.map +1 -1
  37. package/dist/validationResultBuilder.d.ts +2 -4
  38. package/dist/validationResultBuilder.d.ts.map +1 -1
  39. package/dist/validationResultBuilder.js +1 -7
  40. package/dist/validationResultBuilder.js.map +1 -1
  41. package/lib/changeset.js +3 -6
  42. package/lib/changeset.js.map +1 -1
  43. package/lib/changeset_operations/array.js +52 -47
  44. package/lib/changeset_operations/array.js.map +1 -1
  45. package/lib/changeset_operations/indexedCollection.js +13 -14
  46. package/lib/changeset_operations/indexedCollection.js.map +1 -1
  47. package/lib/helpers/typeidHelper.js +16 -26
  48. package/lib/helpers/typeidHelper.js.map +1 -1
  49. package/lib/pathHelper.js +50 -52
  50. package/lib/pathHelper.js.map +1 -1
  51. package/lib/templateValidator.js +64 -38
  52. package/lib/templateValidator.js.map +1 -1
  53. package/lib/utils.js +160 -167
  54. package/lib/utils.js.map +1 -1
  55. package/lib/validationResultBuilder.js +1 -7
  56. package/lib/validationResultBuilder.js.map +1 -1
  57. package/package.json +3 -3
package/lib/utils.js CHANGED
@@ -24,16 +24,17 @@ const { PROPERTY_PATH_DELIMITER, MSG } = constants;
24
24
  * @alias property-changeset.Utils
25
25
  * @class
26
26
  */
27
+ // eslint-disable-next-line @typescript-eslint/no-namespace
27
28
  export var Utils;
28
29
  (function (Utils) {
29
30
  /**
30
- * Traverses a ChangeSet recursively and invokes the callback for each visited property.
31
- *
32
- * @param in_preCallback - The (pre-order) callback function that is invoked for each property
33
- * @param in_postCallback - The (post-order) callback function that is invoked for each property
34
- * @param in_context - The traversal context for the currently processed property
35
- * @param in_levelCallback - A callback for when a node is reached
36
- */
31
+ * Traverses a ChangeSet recursively and invokes the callback for each visited property.
32
+ *
33
+ * @param in_preCallback - The (pre-order) callback function that is invoked for each property
34
+ * @param in_postCallback - The (post-order) callback function that is invoked for each property
35
+ * @param in_context - The traversal context for the currently processed property
36
+ * @param in_levelCallback - A callback for when a node is reached
37
+ */
37
38
  function _traverseChangeSetRecursivelyAsync(in_preCallback, in_postCallback, in_context, in_levelCallback) {
38
39
  let pathSeparator;
39
40
  let currentPath;
@@ -106,14 +107,11 @@ export var Utils;
106
107
  let nextSegmentToPushInParentStack = in_context.getLastSegment();
107
108
  // Note: we don't quote the path string here, since the paths
108
109
  // in a ChangeSet are already quoted, if necessary
109
- if (currentTypeIdContext === "map" ||
110
+ in_context._lastSegmentString = currentTypeIdContext === "map" ||
110
111
  currentTypeIdContext === "array" ||
111
- currentTypeIdContext === "set") {
112
- in_context._lastSegmentString = `[${escapedSegment}]`;
113
- }
114
- else {
115
- in_context._lastSegmentString = pathSeparator + escapedSegment;
116
- }
112
+ currentTypeIdContext === "set"
113
+ ? `[${escapedSegment}]`
114
+ : pathSeparator + escapedSegment;
117
115
  in_context._fullPath = currentPath + in_context.getLastSegmentString();
118
116
  // Store the typeid and nested ChangeSet
119
117
  in_context._typeid = in_nestedTypeid;
@@ -463,14 +461,11 @@ export var Utils;
463
461
  const escapedSegment = in_escape && isString(in_segment) ? PathHelper.quotePathSegmentIfNeeded(in_segment) : in_segment;
464
462
  let nextSegmentToPushInParentStack = in_context._lastSegment;
465
463
  // Note: we don't quote the path string here, since the paths in a ChangeSet are already quoted, if necessary
466
- if (currentTypeIdContext === "map" ||
464
+ in_context._lastSegmentString = currentTypeIdContext === "map" ||
467
465
  currentTypeIdContext === "array" ||
468
- currentTypeIdContext === "set") {
469
- in_context._lastSegmentString = `[${escapedSegment}]`;
470
- }
471
- else {
472
- in_context._lastSegmentString = pathSeparator + escapedSegment;
473
- }
466
+ currentTypeIdContext === "set"
467
+ ? `[${escapedSegment}]`
468
+ : pathSeparator + escapedSegment;
474
469
  in_context._fullPath = currentPath + in_context._lastSegmentString;
475
470
  // Store the typeid and nested ChangeSet
476
471
  in_context._typeid = in_nestedTypeid;
@@ -753,12 +748,9 @@ export var Utils;
753
748
  */
754
749
  getPostLastSegment() {
755
750
  if (this._propertyContainerType === "array" && isNumber(this._lastSegment) && this._arrayIteratorOffset !== undefined) {
756
- if (this._operationType === "remove") {
757
- return this._lastSegment + this._arrayIteratorOffset - this._arrayLocalIndex;
758
- }
759
- else {
760
- return this._lastSegment + this._arrayIteratorOffset;
761
- }
751
+ return this._operationType === "remove"
752
+ ? this._lastSegment + this._arrayIteratorOffset - this._arrayLocalIndex
753
+ : this._lastSegment + this._arrayIteratorOffset;
762
754
  }
763
755
  else {
764
756
  return this._lastSegment;
@@ -983,14 +975,7 @@ export var Utils;
983
975
  }
984
976
  else {
985
977
  // if we're given an extra rootTypeId, use that
986
- if (in_params.rootTypeid) {
987
- context._typeid = in_params.rootTypeid;
988
- }
989
- else {
990
- // By default, we assume that a ChangeSet without a typeid affects a NodeProperty, since that is the default
991
- // for a repository root
992
- context._typeid = "NodeProperty";
993
- }
978
+ context._typeid = in_params.rootTypeid ? in_params.rootTypeid : "NodeProperty";
994
979
  }
995
980
  context._nestedChangeSet = in_changeSet;
996
981
  context._parentNestedChangeSet = in_changeSet;
@@ -1021,14 +1006,7 @@ export var Utils;
1021
1006
  }
1022
1007
  else {
1023
1008
  // if we're given an extra rootTypeId, use that
1024
- if (in_params.rootTypeid) {
1025
- context._typeid = in_params.rootTypeid;
1026
- }
1027
- else {
1028
- // By default, we assume that a ChangeSet without a typeid affects a NodeProperty, since that is the default
1029
- // for a repository root
1030
- context._typeid = "NodeProperty";
1031
- }
1009
+ context._typeid = in_params.rootTypeid ? in_params.rootTypeid : "NodeProperty";
1032
1010
  }
1033
1011
  context._nestedChangeSet = in_changeSet;
1034
1012
  context._parentNestedChangeSet = in_changeSet;
@@ -1069,9 +1047,8 @@ export var Utils;
1069
1047
  * @param in_callback - A callback that is used to emit every template
1070
1048
  * @param in_finalizer - A callback that is called when enumeration is completed
1071
1049
  *
1072
- * @returns All templates that appear in the ChangeSet
1073
- * The returned object has members key (string), corresponding to the type and value with the
1074
- * definition (object)
1050
+ * @returns All templates that appear in the ChangeSet.
1051
+ * The returned object has members key (string), corresponding to the type and value with the definition (object)
1075
1052
  */
1076
1053
  function enumerateSchemas(in_changeSet, in_callback, in_finalizer) {
1077
1054
  const result = [];
@@ -1111,14 +1088,10 @@ export var Utils;
1111
1088
  }
1112
1089
  return;
1113
1090
  }
1114
- let operationScope;
1115
- if (in_context.getPropertyContainerType() !== "template") {
1116
- operationScope = userData[in_context.getOperationType()] = userData[in_context.getOperationType()] ||
1117
- (in_context.getPropertyContainerType() === "array" ? [] : {});
1118
- }
1119
- else {
1120
- operationScope = userData;
1121
- }
1091
+ const operationScope = in_context.getPropertyContainerType() !== "template"
1092
+ ? (userData[in_context.getOperationType()] = userData[in_context.getOperationType()]
1093
+ || (in_context.getPropertyContainerType() === "array" ? [] : {}))
1094
+ : userData;
1122
1095
  if (TypeIdHelper.isPrimitiveType(in_context.getTypeid())) {
1123
1096
  // This is a primitive type, we store it under its name in the result
1124
1097
  operationScope[in_context.getLastSegment()] = in_context.getNestedChangeSet();
@@ -1194,10 +1167,13 @@ export var Utils;
1194
1167
  * @param in_changeSet - The ChangeSet to process
1195
1168
  * @param in_excludetypeids - Exclude all typeids from the returned ChangeSet
1196
1169
  * @throws if path is invalid.
1197
- * @returns The changes that are applied to the given path
1170
+ * @returns The changes that are applied to the given path.
1171
+ *
1172
+ * ```
1198
1173
  * <pre>
1199
1174
  * {insert: Object|undefined, modify: Object|undefined, remove: boolean|undefined}
1200
1175
  * </pre>
1176
+ * ```
1201
1177
  */
1202
1178
  function getChangesByPath(in_path, in_root, in_changeSet, in_excludetypeids) {
1203
1179
  // if we're asked for the root, just return the root (in a modify)
@@ -1269,65 +1245,78 @@ export var Utils;
1269
1245
  /**
1270
1246
  * Invoke a callback for all nested ChangeSets that correspond to a set of user supplied tokenized paths.
1271
1247
  *
1272
- * @param in_paths -
1273
- * A map or object which contains the tokenized paths as nested elements. Common path segment are thus shared.
1274
- * NOTE: It is recommended to use Map as it provides better performance.
1275
- * For example, for these three paths:
1276
- * 'entry1'
1277
- * 'nested.entry2'
1278
- * 'nested.entry3'
1248
+ * @param in_paths - A map or object which contains the tokenized paths as nested elements.
1249
+ * Common path segment are thus shared.
1250
+ *
1251
+ * NOTE: It is recommended to use Map as it provides better performance.
1252
+ * For example, for these three paths:
1253
+ *
1254
+ * - 'entry1'
1255
+ *
1256
+ * - 'nested.entry2'
1257
+ *
1258
+ * - 'nested.entry3'
1279
1259
  *
1280
- * Using a map for paths would look like this:
1281
- * new Map([
1282
- * ['entry', new Map()],
1283
- * ['nested', new Map([
1284
- * ['entry2', new Map()],
1285
- * ['entry3', new Map()]
1286
- * ])]
1287
- * ])
1260
+ * Using a map for paths would look like this:
1288
1261
  *
1289
- * While using objects for paths would look like this:
1290
- * {
1291
- * entry: {},
1292
- * nested: {
1293
- * entry2: {}
1294
- * entry3: {}
1295
- * }
1296
- * }
1262
+ * ```typescript
1263
+ * new Map([
1264
+ * ['entry', new Map()],
1265
+ * ['nested', new Map([
1266
+ * ['entry2', new Map()],
1267
+ * ['entry3', new Map()]
1268
+ * ])]
1269
+ * ])
1270
+ * ```
1297
1271
  *
1298
- * The element under the path, will be provided to the callback. If you have to pass additional data
1299
- * to the callback, you can add private data by prefixing it with __ and setting
1300
- * in_options.escapeLeadingDoubleUnderscore to true.
1301
- * In case you do that, bear in mind that paths that refer to changeSet properties that have at least
1302
- * two underscores as prefix in its id, should contain an extra underscore character as prefix:
1303
- * | Path in changeSet | Path in paths |
1304
- * | path0 | path0 | (unescaped)
1305
- * | _path1 | _path1 | (unescaoed)
1306
- * | __path2 | ___path2 | (escaped with one extra leading underscore)
1307
- * | ___path3 | ____path3 | (also escaped, the same applies to N underscores where N >= 2)
1308
- * @param in_changeSet -
1309
- * The ChangeSet to process
1310
- * @param in_callback -
1311
- * The function to invoke at the registered paths (it is called both for the interior and the leaf nodes). The
1312
- * callback will be called for each node with the following parameters:
1313
- * context - The current TraversalContext as returned by Utils.traverseChangeSetRecursively. Can be used for
1314
- * querying the current Property type, operation, etc.
1315
- * currentSubPaths - a subset of the tokenized paths passed in as input to this
1316
- * function that still need to be processed from the current node
1317
- * currentTokenizedPath - the tokenized path leading to the current node
1318
- * contractedPathSegment - True if the current node is inside a contracted path segment
1319
- * (e.g. currentTokenizedPath is ['foo'], coming from the
1320
- * changeset segment 'foo.bar'), false otherwise. If true, the
1321
- * typeid from the context parameter may not be valid at the
1322
- * current node. Callbacks may ignore this if they are not
1323
- * concerned with the type.
1324
- * @param in_options -
1325
- * @param in_options.rootOperation - The operation that has been applied to the root of the ChangeSet (either 'insert' or 'modify')
1272
+ * While using objects for paths would look like this:
1273
+ *
1274
+ * ```typescript
1275
+ * {
1276
+ * entry: {},
1277
+ * nested: {
1278
+ * entry2: {}
1279
+ * entry3: {}
1280
+ * }
1281
+ * }
1282
+ * ```
1283
+ *
1284
+ * The element under the path, will be provided to the callback. If you have to pass additional data
1285
+ * to the callback, you can add private data by prefixing it with __ and setting
1286
+ * in_options.escapeLeadingDoubleUnderscore to true.
1287
+ * In case you do that, bear in mind that paths that refer to changeSet properties that have at least
1288
+ * two underscores as prefix in its id, should contain an extra underscore character as prefix:
1289
+ *
1290
+ * ```
1291
+ * | Path in changeSet | Path in paths |
1292
+ * | path0 | path0 | (unescaped)
1293
+ * | _path1 | _path1 | (unescaoed)
1294
+ * | __path2 | ___path2 | (escaped with one extra leading underscore)
1295
+ * | ___path3 | ____path3 | (also escaped, the same applies to N underscores where N >= 2)
1296
+ * ```
1297
+ * @param in_changeSet - The ChangeSet to process
1298
+ * @param in_callback - The function to invoke at the registered paths (it is called both for the interior and the
1299
+ * leaf nodes). The callback will be called for each node with the following parameters:
1300
+ *
1301
+ * - `context`: The current TraversalContext as returned by Utils.traverseChangeSetRecursively.
1302
+ * Can be used for querying the current Property type, operation, etc.
1303
+ *
1304
+ * - `currentSubPaths`: A subset of the tokenized paths passed in as input to this function that still need to be
1305
+ * processed from the current node
1306
+ *
1307
+ * - `currentTokenizedPath`: The tokenized path leading to the current node
1308
+ *
1309
+ * - `contractedPathSegment`: True if the current node is inside a contracted path segment (e.g.
1310
+ * currentTokenizedPath is ['foo'], coming from the changeset segment 'foo.bar'), false otherwise. If true, the
1311
+ * typeid from the context parameter may not be valid at the current node. Callbacks may ignore this if they are
1312
+ * not concerned with the type.
1313
+ *
1314
+ * @param in_options.rootOperation - The operation that has been applied to the root of the ChangeSet
1315
+ * (either 'insert' or 'modify')
1326
1316
  * @param in_options.rootTypeid - The full type of the root Property of the ChangeSet
1327
- * @param in_options.escapeLeadingDoubleUnderscore -
1328
- * If this is set to true, keys which start with '__' will be escaped (by adding an additional '_') before the
1329
- * lookup into the paths map. This frees the keyspace with duplicated underscores for the use by the calling
1330
- * application.
1317
+ * @param in_options.escapeLeadingDoubleUnderscore - If this is set to true, keys which start with '__' will be
1318
+ * escaped (by adding an additional '_') before the lookup into the paths map. This frees the keyspace with
1319
+ * duplicated underscores for the use by the calling application.
1331
1320
  */
1332
1321
  function getChangesToTokenizedPaths(in_paths, in_changeSet, in_callback, in_options = { escapeLeadingDoubleUnderscore: false, rootOperation: 'modify' }) {
1333
1322
  const currentTokenizedPath = [];
@@ -1375,14 +1364,11 @@ export var Utils;
1375
1364
  return thisLevel;
1376
1365
  };
1377
1366
  const _toCallbackParam = (pathLevels) => {
1378
- if (legacyPaths) {
1367
+ return legacyPaths
1379
1368
  // If a user provided objects as paths, they would expect objects in their callbacks as well.
1380
1369
  // So, we transform the parameter to an object, which is not very performant but is backwards compatible.
1381
- return _convertMapToLevel(pathLevels);
1382
- }
1383
- else {
1384
- return pathLevels;
1385
- }
1370
+ ? _convertMapToLevel(pathLevels)
1371
+ : pathLevels;
1386
1372
  };
1387
1373
  if (!(in_paths instanceof Map)) {
1388
1374
  legacyPaths = true;
@@ -1478,32 +1464,37 @@ export var Utils;
1478
1464
  * Given a change set, this function will filter it based on a series of paths.
1479
1465
  * The final ChangeSet will only include the paths in question starting from the root of
1480
1466
  * the ChangeSet.
1481
- * For Example,
1482
- * Given the following change set
1483
- * 'insert': {
1484
- * 'String': {
1485
- * 'string1': 'hello',
1486
- * 'string2': 'world
1487
- * }
1488
- * }
1489
- * And the path
1490
- * ['string1']
1491
- * the resulting ChangeSet will be
1492
- * 'insert': {
1493
- * 'String': {
1494
- * 'string1': 'hello'
1495
- * }
1496
- * }
1467
+ *
1468
+ * @example Given the following change set:
1469
+ *
1470
+ * ```json
1471
+ * 'insert': {
1472
+ * 'String': {
1473
+ * 'string1': 'hello',
1474
+ * 'string2': 'world
1475
+ * }
1476
+ * }
1477
+ * ```
1478
+ *
1479
+ * And the path `['string1']`, the resulting ChangeSet will be:
1480
+ *
1481
+ * ```json
1482
+ * 'insert': {
1483
+ * 'String': {
1484
+ * 'string1': 'hello'
1485
+ * }
1486
+ * }
1487
+ * ```
1497
1488
  *
1498
1489
  * NOTE: Paths that traverse through sets and arrays are not supported.
1499
1490
  *
1500
- * @param in_changeSet - The changeset to parse
1491
+ * @param in_changeSet - The changeset to parse.
1501
1492
  * @param in_paths - List of paths to filter by. This can either be passed
1502
- * as a flat array of paths or as a Map with the tokenized, tree structured paths, see the
1503
- * documentation of getChangesToTokenizedPaths for an example.
1504
- * Note: duplicate paths will be ignored including ones that encompasse other paths
1493
+ * as a flat array of paths or as a Map with the tokenized, tree structured paths, see the
1494
+ * documentation of getChangesToTokenizedPaths for an example.
1495
+ * Note: duplicate paths will be ignored including ones that encompasse other paths.
1505
1496
  *
1506
- * @throws if a path given resolves into an array or set
1497
+ * @throws If a path given resolves into an array or set.
1507
1498
  * @returns - Filtered ChangeSet
1508
1499
  */
1509
1500
  function getFilteredChangeSetByPaths(in_changeSet, in_paths) {
@@ -1550,21 +1541,15 @@ export var Utils;
1550
1541
  changeSetToPopulate = pathToChangeSet[parentPath] || changeSetToPopulate;
1551
1542
  }
1552
1543
  else if (index < tokenizedPath.length - 1) {
1553
- if (context.getContainerStack()[index] !== "set" && context.getContainerStack()[index] !== "map") {
1554
- parentPath += `.${PathHelper.quotePathSegmentIfNeeded(segment)}`;
1555
- }
1556
- else {
1557
- parentPath += `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;
1558
- }
1544
+ parentPath += context.getContainerStack()[index] !== "set" && context.getContainerStack()[index] !== "map"
1545
+ ? `.${PathHelper.quotePathSegmentIfNeeded(segment)}`
1546
+ : `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;
1559
1547
  changeSetToPopulate = pathToChangeSet[parentPath] || changeSetToPopulate;
1560
1548
  }
1561
1549
  else {
1562
- if (context.getContainerStack()[index] !== "set" && context.getContainerStack()[index] !== "map") {
1563
- parentPath += `.${PathHelper.quotePathSegmentIfNeeded(segment)}`;
1564
- }
1565
- else {
1566
- parentPath += `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;
1567
- }
1550
+ parentPath += context.getContainerStack()[index] !== "set" && context.getContainerStack()[index] !== "map"
1551
+ ? `.${PathHelper.quotePathSegmentIfNeeded(segment)}`
1552
+ : `[${PathHelper.quotePathSegmentIfNeeded(segment)}]`;
1568
1553
  fullPath = parentPath;
1569
1554
  }
1570
1555
  pathsToDelete.push(parentPath);
@@ -1697,7 +1682,7 @@ export var Utils;
1697
1682
  *
1698
1683
  * @param in_paths - An array with paths
1699
1684
  * @returns {Map} A tree structured representation of the tokenized paths that can be
1700
- * passed to getChangesToTokenizedPaths and getFilteredChangeSetByPaths.
1685
+ * passed to getChangesToTokenizedPaths and getFilteredChangeSetByPaths.
1701
1686
  */
1702
1687
  function convertPathArrayToTree(in_paths) {
1703
1688
  in_paths = Array.isArray(in_paths) ? in_paths : [in_paths];
@@ -1737,22 +1722,27 @@ export var Utils;
1737
1722
  * Given a change set, this function will filter it based on a series of paths.
1738
1723
  * The final ChangeSet will exclude the paths in question starting from the root of
1739
1724
  * the ChangeSet.
1740
- * For Example,
1741
- * Given the following change set
1742
- * 'insert': {
1743
- * 'String': {
1744
- * 'string1': 'hello',
1745
- * 'string2': 'world
1746
- * }
1747
- * }
1748
- * And the path
1749
- * ['string1']
1750
- * the resulting ChangeSet will be
1751
- * 'insert': {
1752
- * 'String': {
1753
- * 'string2': 'world'
1754
- * }
1755
- * }
1725
+ *
1726
+ * @example Given the following change set:
1727
+ *
1728
+ * ```json
1729
+ * 'insert': {
1730
+ * 'String': {
1731
+ * 'string1': 'hello',
1732
+ * 'string2': 'world
1733
+ * }
1734
+ * }
1735
+ * ```
1736
+ *
1737
+ * And the path `['string1']`, the resulting ChangeSet will be:
1738
+ *
1739
+ * ```json
1740
+ * 'insert': {
1741
+ * 'String': {
1742
+ * 'string2': 'world'
1743
+ * }
1744
+ * }
1745
+ * ```
1756
1746
  *
1757
1747
  * NOTE: Paths that traverse through sets and arrays are not supported.
1758
1748
  *
@@ -1787,7 +1777,8 @@ export var Utils;
1787
1777
  Utils.excludePathsFromChangeSet = excludePathsFromChangeSet;
1788
1778
  /**
1789
1779
  * Extract all paths from the ChangeSet in a flattened list and include the operations and typeid information.
1790
- * NOTE: The paths returned also include the parent. i.e. the path 'nodeProp.subproperty' will result in
1780
+ * @remarks NOTE: The paths returned also include the parent. i.e. the path 'nodeProp.subproperty' will result in:
1781
+ * ```json
1791
1782
  * {
1792
1783
  * nodeProp: {
1793
1784
  * operation: 'modify',
@@ -1798,6 +1789,8 @@ export var Utils;
1798
1789
  * typeid: { typeid: 'Float32', context: 'single', isEnum: false }
1799
1790
  * }
1800
1791
  * }
1792
+ * ```
1793
+ *
1801
1794
  * @param in_changeSet - The changeset to extract paths from
1802
1795
  * @param in_options - Set of options
1803
1796
  * @param in_options.includeOperation - Flag to include the operation