@fluid-experimental/property-properties 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +1 -0
  2. package/dist/containerSerializer.d.ts.map +1 -1
  3. package/dist/containerSerializer.js +5 -5
  4. package/dist/containerSerializer.js.map +1 -1
  5. package/dist/enableValidations.js.map +1 -1
  6. package/dist/index.d.ts +19 -19
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
  10. package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  11. package/dist/properties/abstractStaticCollectionProperty.js +70 -53
  12. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  13. package/dist/properties/arrayProperty.d.ts.map +1 -1
  14. package/dist/properties/arrayProperty.js +152 -103
  15. package/dist/properties/arrayProperty.js.map +1 -1
  16. package/dist/properties/baseProperty.d.ts +4 -4
  17. package/dist/properties/baseProperty.d.ts.map +1 -1
  18. package/dist/properties/baseProperty.js +69 -47
  19. package/dist/properties/baseProperty.js.map +1 -1
  20. package/dist/properties/boolProperty.d.ts.map +1 -1
  21. package/dist/properties/boolProperty.js +3 -3
  22. package/dist/properties/boolProperty.js.map +1 -1
  23. package/dist/properties/containerProperty.d.ts +8 -8
  24. package/dist/properties/containerProperty.d.ts.map +1 -1
  25. package/dist/properties/containerProperty.js +33 -26
  26. package/dist/properties/containerProperty.js.map +1 -1
  27. package/dist/properties/enumArrayProperty.d.ts.map +1 -1
  28. package/dist/properties/enumArrayProperty.js +14 -14
  29. package/dist/properties/enumArrayProperty.js.map +1 -1
  30. package/dist/properties/enumProperty.d.ts.map +1 -1
  31. package/dist/properties/enumProperty.js +17 -17
  32. package/dist/properties/enumProperty.js.map +1 -1
  33. package/dist/properties/floatProperties.js +4 -4
  34. package/dist/properties/floatProperties.js.map +1 -1
  35. package/dist/properties/index.d.ts +23 -23
  36. package/dist/properties/index.d.ts.map +1 -1
  37. package/dist/properties/index.js.map +1 -1
  38. package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  39. package/dist/properties/indexedCollectionBaseProperty.js +47 -37
  40. package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
  41. package/dist/properties/intProperties.d.ts.map +1 -1
  42. package/dist/properties/intProperties.js +10 -10
  43. package/dist/properties/intProperties.js.map +1 -1
  44. package/dist/properties/lazyLoadedProperties.js.map +1 -1
  45. package/dist/properties/mapProperty.d.ts.map +1 -1
  46. package/dist/properties/mapProperty.js +21 -17
  47. package/dist/properties/mapProperty.js.map +1 -1
  48. package/dist/properties/namedNodeProperty.d.ts.map +1 -1
  49. package/dist/properties/namedNodeProperty.js +3 -3
  50. package/dist/properties/namedNodeProperty.js.map +1 -1
  51. package/dist/properties/namedProperty.d.ts.map +1 -1
  52. package/dist/properties/namedProperty.js +7 -5
  53. package/dist/properties/namedProperty.js.map +1 -1
  54. package/dist/properties/nodeProperty.d.ts.map +1 -1
  55. package/dist/properties/nodeProperty.js +5 -3
  56. package/dist/properties/nodeProperty.js.map +1 -1
  57. package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
  58. package/dist/properties/primitiveTypeCasts.js +9 -9
  59. package/dist/properties/primitiveTypeCasts.js.map +1 -1
  60. package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
  61. package/dist/properties/referenceArrayProperty.js +31 -25
  62. package/dist/properties/referenceArrayProperty.js.map +1 -1
  63. package/dist/properties/referenceMapProperty.d.ts.map +1 -1
  64. package/dist/properties/referenceMapProperty.js +18 -18
  65. package/dist/properties/referenceMapProperty.js.map +1 -1
  66. package/dist/properties/referenceProperty.d.ts.map +1 -1
  67. package/dist/properties/referenceProperty.js +33 -29
  68. package/dist/properties/referenceProperty.js.map +1 -1
  69. package/dist/properties/setProperty.d.ts.map +1 -1
  70. package/dist/properties/setProperty.js +31 -29
  71. package/dist/properties/setProperty.js.map +1 -1
  72. package/dist/properties/stringProperty.d.ts.map +1 -1
  73. package/dist/properties/stringProperty.js +56 -40
  74. package/dist/properties/stringProperty.js.map +1 -1
  75. package/dist/properties/uintProperties.js +5 -5
  76. package/dist/properties/uintProperties.js.map +1 -1
  77. package/dist/properties/valueArrayProperty.d.ts +1 -1
  78. package/dist/properties/valueArrayProperty.d.ts.map +1 -1
  79. package/dist/properties/valueArrayProperty.js +30 -29
  80. package/dist/properties/valueArrayProperty.js.map +1 -1
  81. package/dist/properties/valueMapProperty.d.ts.map +1 -1
  82. package/dist/properties/valueMapProperty.js +31 -29
  83. package/dist/properties/valueMapProperty.js.map +1 -1
  84. package/dist/properties/valueProperty.d.ts.map +1 -1
  85. package/dist/properties/valueProperty.js +11 -9
  86. package/dist/properties/valueProperty.js.map +1 -1
  87. package/dist/propertyFactory.d.ts.map +1 -1
  88. package/dist/propertyFactory.js +309 -252
  89. package/dist/propertyFactory.js.map +1 -1
  90. package/dist/propertyTemplate.d.ts +17 -17
  91. package/dist/propertyTemplate.d.ts.map +1 -1
  92. package/dist/propertyTemplate.js +64 -45
  93. package/dist/propertyTemplate.js.map +1 -1
  94. package/dist/propertyTemplateWrapper.d.ts.map +1 -1
  95. package/dist/propertyTemplateWrapper.js +40 -25
  96. package/dist/propertyTemplateWrapper.js.map +1 -1
  97. package/dist/propertyUtils.d.ts.map +1 -1
  98. package/dist/propertyUtils.js.map +1 -1
  99. package/dist/test/properties/arrayProperty.spec.js +566 -490
  100. package/dist/test/properties/arrayProperty.spec.js.map +1 -1
  101. package/dist/test/properties/baseProperty.spec.js +293 -280
  102. package/dist/test/properties/baseProperty.spec.js.map +1 -1
  103. package/dist/test/properties/containerProperty.spec.js +100 -94
  104. package/dist/test/properties/containerProperty.spec.js.map +1 -1
  105. package/dist/test/properties/customArrayProperty.spec.js +174 -147
  106. package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
  107. package/dist/test/properties/enumArrayProperty.spec.js +67 -63
  108. package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
  109. package/dist/test/properties/enumProperty.spec.js +115 -97
  110. package/dist/test/properties/enumProperty.spec.js.map +1 -1
  111. package/dist/test/properties/float32.spec.js +5 -5
  112. package/dist/test/properties/float32.spec.js.map +1 -1
  113. package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
  114. package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
  115. package/dist/test/properties/int64MapProperty.spec.js +185 -166
  116. package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
  117. package/dist/test/properties/int64Property.spec.js +109 -109
  118. package/dist/test/properties/int64Property.spec.js.map +1 -1
  119. package/dist/test/properties/isLeafNode.spec.js +75 -76
  120. package/dist/test/properties/isLeafNode.spec.js.map +1 -1
  121. package/dist/test/properties/mapProperty.spec.js +571 -531
  122. package/dist/test/properties/mapProperty.spec.js.map +1 -1
  123. package/dist/test/properties/namedNodeProperty.spec.js +31 -31
  124. package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
  125. package/dist/test/properties/nodeProperty.spec.js +805 -795
  126. package/dist/test/properties/nodeProperty.spec.js.map +1 -1
  127. package/dist/test/properties/referenceProperty.spec.js +729 -679
  128. package/dist/test/properties/referenceProperty.spec.js.map +1 -1
  129. package/dist/test/properties/relationshipProperty.spec.js +16 -16
  130. package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
  131. package/dist/test/properties/setProperty.spec.js +288 -227
  132. package/dist/test/properties/setProperty.spec.js.map +1 -1
  133. package/dist/test/properties/stringProperty.spec.js +326 -318
  134. package/dist/test/properties/stringProperty.spec.js.map +1 -1
  135. package/dist/test/properties/uint64Property.spec.js +46 -36
  136. package/dist/test/properties/uint64Property.spec.js.map +1 -1
  137. package/dist/test/properties/valueMapProperty.spec.js +259 -246
  138. package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
  139. package/dist/test/properties/valueProperty.spec.js +49 -43
  140. package/dist/test/properties/valueProperty.spec.js.map +1 -1
  141. package/dist/test/propertyFactory.spec.js +2038 -1631
  142. package/dist/test/propertyFactory.spec.js.map +1 -1
  143. package/dist/test/propertyTemplateWrapper.spec.js +72 -102
  144. package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
  145. package/dist/test/propertyUtils.spec.js +22 -21
  146. package/dist/test/propertyUtils.spec.js.map +1 -1
  147. package/dist/test/reversibleChangeset.spec.js +857 -703
  148. package/dist/test/reversibleChangeset.spec.js.map +1 -1
  149. package/dist/test/setup.js +5 -5
  150. package/dist/test/setup.js.map +1 -1
  151. package/dist/test/tsconfig.tsbuildinfo +1 -1
  152. package/dist/test/utils.spec.js +1334 -1144
  153. package/dist/test/utils.spec.js.map +1 -1
  154. package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
  155. package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
  156. package/dist/test/validation/badPrimitiveTypeid.js +12 -12
  157. package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
  158. package/dist/test/validation/goodColorId.js +91 -91
  159. package/dist/test/validation/goodColorId.js.map +1 -1
  160. package/dist/test/validation/goodColorPalette.js +4 -4
  161. package/dist/test/validation/goodColorPalette.js.map +1 -1
  162. package/dist/test/validation/goodPointId.js +20 -20
  163. package/dist/test/validation/goodPointId.js.map +1 -1
  164. package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
  165. package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
  166. package/lib/containerSerializer.d.ts.map +1 -1
  167. package/lib/containerSerializer.js +5 -5
  168. package/lib/containerSerializer.js.map +1 -1
  169. package/lib/enableValidations.js.map +1 -1
  170. package/lib/index.d.ts +19 -19
  171. package/lib/index.d.ts.map +1 -1
  172. package/lib/index.js +19 -19
  173. package/lib/index.js.map +1 -1
  174. package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
  175. package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  176. package/lib/properties/abstractStaticCollectionProperty.js +70 -53
  177. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  178. package/lib/properties/arrayProperty.d.ts.map +1 -1
  179. package/lib/properties/arrayProperty.js +152 -103
  180. package/lib/properties/arrayProperty.js.map +1 -1
  181. package/lib/properties/baseProperty.d.ts +4 -4
  182. package/lib/properties/baseProperty.d.ts.map +1 -1
  183. package/lib/properties/baseProperty.js +73 -51
  184. package/lib/properties/baseProperty.js.map +1 -1
  185. package/lib/properties/boolProperty.d.ts.map +1 -1
  186. package/lib/properties/boolProperty.js +3 -3
  187. package/lib/properties/boolProperty.js.map +1 -1
  188. package/lib/properties/containerProperty.d.ts +8 -8
  189. package/lib/properties/containerProperty.d.ts.map +1 -1
  190. package/lib/properties/containerProperty.js +33 -26
  191. package/lib/properties/containerProperty.js.map +1 -1
  192. package/lib/properties/enumArrayProperty.d.ts.map +1 -1
  193. package/lib/properties/enumArrayProperty.js +14 -14
  194. package/lib/properties/enumArrayProperty.js.map +1 -1
  195. package/lib/properties/enumProperty.d.ts.map +1 -1
  196. package/lib/properties/enumProperty.js +17 -17
  197. package/lib/properties/enumProperty.js.map +1 -1
  198. package/lib/properties/floatProperties.js +4 -4
  199. package/lib/properties/floatProperties.js.map +1 -1
  200. package/lib/properties/index.d.ts +23 -23
  201. package/lib/properties/index.d.ts.map +1 -1
  202. package/lib/properties/index.js +23 -23
  203. package/lib/properties/index.js.map +1 -1
  204. package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  205. package/lib/properties/indexedCollectionBaseProperty.js +47 -37
  206. package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
  207. package/lib/properties/intProperties.d.ts.map +1 -1
  208. package/lib/properties/intProperties.js +10 -10
  209. package/lib/properties/intProperties.js.map +1 -1
  210. package/lib/properties/lazyLoadedProperties.js.map +1 -1
  211. package/lib/properties/mapProperty.d.ts.map +1 -1
  212. package/lib/properties/mapProperty.js +21 -17
  213. package/lib/properties/mapProperty.js.map +1 -1
  214. package/lib/properties/namedNodeProperty.d.ts.map +1 -1
  215. package/lib/properties/namedNodeProperty.js +3 -3
  216. package/lib/properties/namedNodeProperty.js.map +1 -1
  217. package/lib/properties/namedProperty.d.ts.map +1 -1
  218. package/lib/properties/namedProperty.js +7 -5
  219. package/lib/properties/namedProperty.js.map +1 -1
  220. package/lib/properties/nodeProperty.d.ts.map +1 -1
  221. package/lib/properties/nodeProperty.js +5 -3
  222. package/lib/properties/nodeProperty.js.map +1 -1
  223. package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
  224. package/lib/properties/primitiveTypeCasts.js +9 -9
  225. package/lib/properties/primitiveTypeCasts.js.map +1 -1
  226. package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
  227. package/lib/properties/referenceArrayProperty.js +31 -25
  228. package/lib/properties/referenceArrayProperty.js.map +1 -1
  229. package/lib/properties/referenceMapProperty.d.ts.map +1 -1
  230. package/lib/properties/referenceMapProperty.js +18 -18
  231. package/lib/properties/referenceMapProperty.js.map +1 -1
  232. package/lib/properties/referenceProperty.d.ts.map +1 -1
  233. package/lib/properties/referenceProperty.js +33 -29
  234. package/lib/properties/referenceProperty.js.map +1 -1
  235. package/lib/properties/setProperty.d.ts.map +1 -1
  236. package/lib/properties/setProperty.js +31 -29
  237. package/lib/properties/setProperty.js.map +1 -1
  238. package/lib/properties/stringProperty.d.ts.map +1 -1
  239. package/lib/properties/stringProperty.js +56 -40
  240. package/lib/properties/stringProperty.js.map +1 -1
  241. package/lib/properties/uintProperties.js +5 -5
  242. package/lib/properties/uintProperties.js.map +1 -1
  243. package/lib/properties/valueArrayProperty.d.ts +1 -1
  244. package/lib/properties/valueArrayProperty.d.ts.map +1 -1
  245. package/lib/properties/valueArrayProperty.js +30 -29
  246. package/lib/properties/valueArrayProperty.js.map +1 -1
  247. package/lib/properties/valueMapProperty.d.ts.map +1 -1
  248. package/lib/properties/valueMapProperty.js +31 -29
  249. package/lib/properties/valueMapProperty.js.map +1 -1
  250. package/lib/properties/valueProperty.d.ts.map +1 -1
  251. package/lib/properties/valueProperty.js +11 -9
  252. package/lib/properties/valueProperty.js.map +1 -1
  253. package/lib/propertyFactory.d.ts.map +1 -1
  254. package/lib/propertyFactory.js +309 -252
  255. package/lib/propertyFactory.js.map +1 -1
  256. package/lib/propertyTemplate.d.ts +17 -17
  257. package/lib/propertyTemplate.d.ts.map +1 -1
  258. package/lib/propertyTemplate.js +64 -45
  259. package/lib/propertyTemplate.js.map +1 -1
  260. package/lib/propertyTemplateWrapper.d.ts.map +1 -1
  261. package/lib/propertyTemplateWrapper.js +40 -25
  262. package/lib/propertyTemplateWrapper.js.map +1 -1
  263. package/lib/propertyUtils.d.ts.map +1 -1
  264. package/lib/propertyUtils.js.map +1 -1
  265. package/package.json +28 -28
  266. package/src/index.d.ts +2750 -2681
@@ -5,14 +5,14 @@
5
5
  /**
6
6
  * @fileoverview Definition of the map property class
7
7
  */
8
- const { PathHelper, TypeIdHelper } = require('@fluid-experimental/property-changeset');
9
- const { MSG } = require('@fluid-experimental/property-common').constants;
10
- const { ConsoleUtils } = require('@fluid-experimental/property-common');
11
- const _ = require('lodash');
12
- const { AbstractStaticCollectionProperty } = require('./abstractStaticCollectionProperty');
13
- const { BaseProperty } = require('./baseProperty');
14
- const { IndexedCollectionBaseProperty } = require('./indexedCollectionBaseProperty');
15
- const { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');
8
+ const { PathHelper, TypeIdHelper } = require("@fluid-experimental/property-changeset");
9
+ const { MSG } = require("@fluid-experimental/property-common").constants;
10
+ const { ConsoleUtils } = require("@fluid-experimental/property-common");
11
+ const _ = require("lodash");
12
+ const { AbstractStaticCollectionProperty } = require("./abstractStaticCollectionProperty");
13
+ const { BaseProperty } = require("./baseProperty");
14
+ const { IndexedCollectionBaseProperty } = require("./indexedCollectionBaseProperty");
15
+ const { LazyLoadedProperties: Property } = require("./lazyLoadedProperties");
16
16
  const PATH_TOKENS = BaseProperty.PATH_TOKENS;
17
17
  /**
18
18
  * typedef {property-properties.BaseProperty|string|number|boolean} property-properties.MapProperty~MapValueType
@@ -36,7 +36,7 @@ export class MapProperty extends IndexedCollectionBaseProperty {
36
36
  constructor(in_params, in_scope) {
37
37
  super(in_params);
38
38
  this._scope = in_scope;
39
- this._contextKeyType = in_params.contextKeyType || 'string';
39
+ this._contextKeyType = in_params.contextKeyType || "string";
40
40
  /** Contains the actual entries of the map */
41
41
  this._dynamicChildren = {};
42
42
  }
@@ -48,7 +48,7 @@ export class MapProperty extends IndexedCollectionBaseProperty {
48
48
  getFullTypeid(in_hideCollection = false) {
49
49
  return in_hideCollection
50
50
  ? this._typeid
51
- : TypeIdHelper.createSerializationTypeId(this._typeid, 'map');
51
+ : TypeIdHelper.createSerializationTypeId(this._typeid, "map");
52
52
  }
53
53
  /**
54
54
  * Is this property a leaf node with regard to flattening?
@@ -83,10 +83,13 @@ export class MapProperty extends IndexedCollectionBaseProperty {
83
83
  else {
84
84
  var that = this;
85
85
  _.each(in_values, function (value, key) {
86
- var property = that.get(String(key), { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });
86
+ var property = that.get(String(key), {
87
+ referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,
88
+ });
87
89
  // if key exists in set replace its value else insert a new key/value
88
90
  if (property) {
89
- if (property instanceof Property.ValueProperty || property instanceof Property.StringProperty) {
91
+ if (property instanceof Property.ValueProperty ||
92
+ property instanceof Property.StringProperty) {
90
93
  property.setValue(value);
91
94
  }
92
95
  else if (property instanceof BaseProperty && _.isObject(value)) {
@@ -187,7 +190,7 @@ export class MapProperty extends IndexedCollectionBaseProperty {
187
190
  * @protected
188
191
  */
189
192
  _getPathSegmentForChildNode(in_childNode) {
190
- return '[' + PathHelper.quotePathSegmentIfNeeded(in_childNode._id) + ']';
193
+ return "[" + PathHelper.quotePathSegmentIfNeeded(in_childNode._id) + "]";
191
194
  }
192
195
  /**
193
196
  * Resolves a direct child node based on the given path segment
@@ -308,8 +311,9 @@ export class MapProperty extends IndexedCollectionBaseProperty {
308
311
  else {
309
312
  in_options = in_options || {};
310
313
  in_options.referenceResolutionMode =
311
- in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :
312
- in_options.referenceResolutionMode;
314
+ in_options.referenceResolutionMode === undefined
315
+ ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS
316
+ : in_options.referenceResolutionMode;
313
317
  var prop = this;
314
318
  switch (in_ids) {
315
319
  case PATH_TOKENS.ROOT: {
@@ -388,6 +392,6 @@ export class MapProperty extends IndexedCollectionBaseProperty {
388
392
  });
389
393
  }
390
394
  }
391
- MapProperty.prototype._typeid = 'BaseProperty';
392
- MapProperty.prototype._context = 'map';
395
+ MapProperty.prototype._typeid = "BaseProperty";
396
+ MapProperty.prototype._context = "map";
393
397
  //# sourceMappingURL=mapProperty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapProperty.js","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,EAAE,6BAA6B,EAAE,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAC;AACrF,MAAM,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE7E,MAAM,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;AAE7C;;;;;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,IAAI,CAAC,MAAM,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK;QACD,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,UAAS,EAAE;YAC7B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,WAAW,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC;AAC/C,WAAW,CAAC,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the map property class\n */\nconst { PathHelper, TypeIdHelper } = require('@fluid-experimental/property-changeset');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { ConsoleUtils } = require('@fluid-experimental/property-common');\nconst _ = require('lodash');\nconst { AbstractStaticCollectionProperty } = require('./abstractStaticCollectionProperty');\nconst { BaseProperty } = require('./baseProperty');\nconst { IndexedCollectionBaseProperty } = require('./indexedCollectionBaseProperty');\nconst { LazyLoadedProperties: Property } = require('./lazyLoadedProperties');\n\nconst PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * typedef {property-properties.BaseProperty|string|number|boolean} property-properties.MapProperty~MapValueType\n *\n * The type of the values that are set/inserted into the map. Depending on the type of the map, these can either\n * be property objects or primitive values\n */\n\n/**\n * A MapProperty is a collection class that can contain an dictionary that maps from strings to properties.\n */\nexport class MapProperty extends IndexedCollectionBaseProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n * @param {string|undefined} in_scope - The scope in which the map typeid is defined\n * @constructor\n * @protected\n * @extends property-properties.IndexedCollectionBaseProperty\n * @alias property-properties.MapProperty\n * @category Maps\n */\n constructor(in_params, in_scope) {\n super(in_params);\n\n this._scope = in_scope;\n this._contextKeyType = in_params.contextKeyType || 'string';\n\n /** Contains the actual entries of the map */\n this._dynamicChildren = {};\n }\n\n /**\n * Returns the full property type identifier for the ChangeSet including the enum type id\n * @param {boolean} [in_hideCollection=false] - If true the collection type (if applicable) will be omitted\n * @return {string} The typeid\n */\n getFullTypeid(in_hideCollection = false) {\n return in_hideCollection\n ? this._typeid\n : TypeIdHelper.createSerializationTypeId(this._typeid, 'map');\n }\n\n /**\n * Is this property a leaf node with regard to flattening?\n *\n * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n *\n * @return {boolean} Is it a leaf with regard to flattening?\n */\n _isFlattenLeaf() {\n return true;\n }\n\n /**\n * Sets multiple values in a map.\n *\n * See {@link MapProperty.setValues}\n *\n * @param {object} in_values - to assign to the collection\n * @param {Boolean} in_typed - If the map's items have a typeid and a value then create the\n * properties with that typeid, else use the set's typeid (support polymorphic items).\n * @private\n */\n _setValuesInternal(in_values, in_typed) {\n if (this._containsPrimitiveTypes) {\n var that = this;\n _.each(in_values, function(value, key) {\n if (that.has(key)) {\n that.remove(key);\n }\n\n that.insert(key, value);\n });\n } else {\n var that = this;\n _.each(in_values, function(value, key) {\n var property = that.get(String(key), { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n // if key exists in set replace its value else insert a new key/value\n if (property) {\n if (property instanceof Property.ValueProperty || property instanceof Property.StringProperty) {\n property.setValue(value);\n } else if (property instanceof BaseProperty && _.isObject(value)) {\n property._setValues(value, false, false);\n } else {\n throw new TypeError(MSG.SET_VALUES_PATH_INVALID + key);\n }\n } else {\n if (value instanceof BaseProperty) {\n that.insert(key, value);\n } else {\n if (in_typed) {\n that.insert(key, Property.PropertyFactory._createProperty(\n value.typeid || that._typeid, null, value.value, that._getScope()));\n } else {\n that.insert(key, Property.PropertyFactory._createProperty(\n that._typeid, null, value, that._getScope()));\n }\n }\n }\n });\n }\n }\n\n /**\n * Sets multiple values in a map.\n *\n * See {@link MapProperty.setValues}\n *\n * @param {object} in_values - to assign to the collection\n * @param {Bool} in_typed - Whether the values are typed/polymorphic.\n * @param {Bool} in_initial - Whether we are setting default/initial values or if the function is called directly\n * with the values to set.\n *\n * @override\n */\n _setValues(in_values, in_typed, in_initial) {\n if (in_initial) {\n this.clear();\n }\n\n this._setValuesInternal(in_values, in_typed);\n }\n\n /**\n * Sets multiple values in a map.\n *\n * @param {object} in_values - to assign to the collection\n * @throws If one of the path in in_values does not exist in this property\n * @throws If trying to set a value to a path that leads to a Property other than ValueProperty or StringProperty\n *\n * @override\n */\n setValues(in_values) {\n var checkoutView = this._getCheckoutView();\n if (checkoutView !== undefined) {\n checkoutView.pushNotificationDelayScope();\n this._setValues(in_values, false, false);\n checkoutView.popNotificationDelayScope();\n } else {\n this._setValues(in_values, false, false);\n }\n }\n\n /**\n * Returns an object with all the nested values contained in this property.\n *\n * @example\n * ```javascript\n * {\n * 'firstString': {\n * 'stringValue': 'test1'\n * },\n * 'secondString': {\n * 'stringValue': 'test2'\n * }\n * }\n */\n getValues() {\n var ids = this.getIds();\n var result = {};\n for (var i = 0; i < ids.length; i++) {\n var child = this.get(ids[i]);\n if (child.isPrimitiveType()) {\n result[ids[i]] = this.get(ids[i]).getValue();\n } else {\n result[ids[i]] = child.getValues();\n }\n }\n return result;\n }\n\n /**\n * Returns the path segment for a child\n *\n * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n *\n * @return {string} The path segment to resolve the child property under this property\n * @protected\n */\n _getPathSegmentForChildNode(in_childNode) {\n return '[' + PathHelper.quotePathSegmentIfNeeded(in_childNode._id) + ']';\n }\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n return in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n ? this._dynamicChildren[in_segment]\n : AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n this,\n in_segment,\n in_segmentType);\n }\n\n /**\n * Inserts a property or value into the map\n *\n * Note: This will trigger an exception when this key already exists in the map. If you want to overwrite\n * existing entries you can use the set function.\n *\n * @param {string} in_key - The key under which the entry is added\n * @param {property-properties.Property} in_property - The property to insert\n * @throws If the property already exists\n * @throws If the property already has a parent\n * @throws If in_key is not a string\n * @throws If the property is a root property\n */\n insert(in_key, in_property) {\n ConsoleUtils.assert(_.isString(in_key), MSG.KEY_NOT_STRING + in_key);\n if (this._dynamicChildren[in_key] !== undefined) {\n throw new Error(MSG.PROPERTY_ALREADY_EXISTS + in_key);\n }\n if (in_property instanceof BaseProperty) {\n in_property._validateInsertIn(this);\n // Set the ID of the entry, to make sure it corresponds to the used key\n in_property._setId(in_key);\n\n // Insert the entry into the collection\n this._insert(in_key, in_property, true);\n } else {\n throw new TypeError(MSG.NONVALUE_MAP_INSERT_PROP);\n }\n }\n\n /**\n * Removes the entry with the given key from the map\n *\n * @param {string} in_key - The key of the entry to remove from the map\n * @throws If trying to remove an entry that does not exist\n * @return {*} the item removed\n */\n remove(in_key) {\n var item = this.get(in_key);\n this._removeByKey(in_key, true);\n return item;\n }\n\n /**\n * Sets the entry with the given key to the property passed in\n *\n * Note: this will overwrite an already existing value\n *\n * @param {string} in_key - The key under which the entry is stored\n * @param {property-properties.MapProperty~MapValueType} in_property - The property to store in the map\n * @throws If in_property is not a property\n * @throws If trying to insert a property that has a parent\n * @throws If in_key is not a string or a number\n */\n set(in_key, in_property) {\n this._checkIsNotReadOnly(true);\n if (this._dynamicChildren[in_key] !== in_property) {\n if (this._containsPrimitiveTypes === false && in_property.getParent() !== undefined) {\n throw new Error(MSG.INSERTED_ENTRY_WITH_PARENT);\n }\n if (this._dynamicChildren[in_key] !== undefined) {\n this._removeByKey(in_key, false);\n }\n // Set the ID of the entry, to make sure it corresponds to the used key\n if (this._containsPrimitiveTypes === false) {\n in_property._setId(in_key);\n }\n this._insert(in_key, in_property, false);\n\n // Make one final report\n this._reportDirtinessToView();\n }\n }\n\n /**\n * Returns an Object with all the entries of the map.\n * Contrary ot .getValues, for Property Maps, this will return the Property, not an object with their nested values.\n * WARNING: This is a direct access to the internal data-structure and the collection MUST NOT be modified. It is\n * read only for fast access and iteration. Insertion and deletion MUST be done via the insert and remove functions\n * of this class.\n *\n * @return {Object} The map with all entries in the map.\n */\n getEntriesReadOnly() {\n return this._dynamicChildren;\n }\n\n /**\n * Returns the collection entry with the given key\n *\n * @param {string|array<string>} in_ids - key of the entry to return or an array of keys\n * if an array is passed, the .get function will be performed on each id in sequence\n * for example .get(['position','x']) is equivalent to .get('position').get('x').\n * If .get resolves to a ReferenceProperty, it will return the property that the ReferenceProperty\n * refers to.\n * @param {Object} in_options - parameter object\n * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]- -\n * How should this function behave during reference resolution?\n *\n * @return {property-properties.Property|*|undefined} The entry in the collection or undefined\n * if none could be found\n */\n get(in_ids, in_options) {\n if (_.isArray(in_ids)) {\n // Forward handling of arrays to the BaseProperty function\n return AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n } else {\n in_options = in_options || {};\n in_options.referenceResolutionMode =\n in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :\n in_options.referenceResolutionMode;\n\n var prop = this;\n switch (in_ids) {\n case PATH_TOKENS.ROOT: {\n prop = prop.getRoot();\n break;\n }\n case PATH_TOKENS.UP: {\n prop = prop.getParent();\n break;\n }\n case PATH_TOKENS.REF: {\n throw new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n }\n default: {\n prop = prop._dynamicChildren[in_ids];\n break;\n }\n }\n\n // Handle automatic reference resolution\n if (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n if (prop instanceof Property.ReferenceProperty) {\n prop = prop.ref;\n }\n }\n\n return prop;\n }\n }\n\n /**\n * Checks whether an entry with the given name exists\n *\n * @param {string} in_id - Name of the property\n * @return {boolean} True if the property exists, otherwise false.\n */\n has(in_id) {\n return this._dynamicChildren[in_id] !== undefined;\n }\n\n /**\n * Returns all entries of the map as an array.\n *\n * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n *\n * @return {Array.<property-properties.BaseProperty | *>} Array with all entries of the map. This array\n * is a shallow copy which can be modified by the caller without effects on the map.\n */\n getAsArray() {\n return _.values(this._dynamicChildren);\n }\n\n /**\n * Returns all keys found in the map\n *\n * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n *\n * @return {Array.<string>} The keys\n */\n getIds() {\n return Object.keys(this._dynamicChildren);\n }\n\n /**\n * Get the scope to which this property belongs to.\n * @return {string|undefined} The guid representing the scope in which the\n * map belongs to. If there is a workspace scope return it, else return the scope of this map.\n * @override\n * @private\n */\n _getScope() {\n var scope = IndexedCollectionBaseProperty.prototype._getScope.call(this);\n\n return scope !== undefined ? scope : this._scope;\n }\n\n /**\n * Deletes all values from the Map\n */\n clear() {\n var that = this;\n this.getIds().forEach(function(id) {\n that.remove(id);\n });\n }\n}\n\nMapProperty.prototype._typeid = 'BaseProperty';\nMapProperty.prototype._context = 'map';\n"]}
1
+ {"version":3,"file":"mapProperty.js","sourceRoot":"","sources":["../../src/properties/mapProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;AACvF,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxE,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,g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;IAC3C,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACR,IAAI,KAAK,GAAG,6BAA6B,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzE,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE;YACjC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAED,WAAW,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC;AAC/C,WAAW,CAAC,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the map property class\n */\nconst { PathHelper, TypeIdHelper } = require(\"@fluid-experimental/property-changeset\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { ConsoleUtils } = require(\"@fluid-experimental/property-common\");\nconst _ = require(\"lodash\");\nconst { AbstractStaticCollectionProperty } = require(\"./abstractStaticCollectionProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\nconst { IndexedCollectionBaseProperty } = require(\"./indexedCollectionBaseProperty\");\nconst { LazyLoadedProperties: Property } = require(\"./lazyLoadedProperties\");\n\nconst PATH_TOKENS = BaseProperty.PATH_TOKENS;\n\n/**\n * typedef {property-properties.BaseProperty|string|number|boolean} property-properties.MapProperty~MapValueType\n *\n * The type of the values that are set/inserted into the map. Depending on the type of the map, these can either\n * be property objects or primitive values\n */\n\n/**\n * A MapProperty is a collection class that can contain an dictionary that maps from strings to properties.\n */\nexport class MapProperty extends IndexedCollectionBaseProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t * @param {string|undefined} in_scope - The scope in which the map typeid is defined\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.IndexedCollectionBaseProperty\n\t * @alias property-properties.MapProperty\n\t * @category Maps\n\t */\n\tconstructor(in_params, in_scope) {\n\t\tsuper(in_params);\n\n\t\tthis._scope = in_scope;\n\t\tthis._contextKeyType = in_params.contextKeyType || \"string\";\n\n\t\t/** Contains the actual entries of the map */\n\t\tthis._dynamicChildren = {};\n\t}\n\n\t/**\n\t * Returns the full property type identifier for the ChangeSet including the enum type id\n\t * @param {boolean} [in_hideCollection=false] - If true the collection type (if applicable) will be omitted\n\t * @return {string} The typeid\n\t */\n\tgetFullTypeid(in_hideCollection = false) {\n\t\treturn in_hideCollection\n\t\t\t? this._typeid\n\t\t\t: TypeIdHelper.createSerializationTypeId(this._typeid, \"map\");\n\t}\n\n\t/**\n\t * Is this property a leaf node with regard to flattening?\n\t *\n\t * TODO: Which semantics should flattening have? It stops at primitive types and collections?\n\t *\n\t * @return {boolean} Is it a leaf with regard to flattening?\n\t */\n\t_isFlattenLeaf() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Sets multiple values in a map.\n\t *\n\t * See {@link MapProperty.setValues}\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @param {Boolean} in_typed - If the map's items have a typeid and a value then create the\n\t * properties with that typeid, else use the set's typeid (support polymorphic items).\n\t * @private\n\t */\n\t_setValuesInternal(in_values, in_typed) {\n\t\tif (this._containsPrimitiveTypes) {\n\t\t\tvar that = this;\n\t\t\t_.each(in_values, function (value, key) {\n\t\t\t\tif (that.has(key)) {\n\t\t\t\t\tthat.remove(key);\n\t\t\t\t}\n\n\t\t\t\tthat.insert(key, value);\n\t\t\t});\n\t\t} else {\n\t\t\tvar that = this;\n\t\t\t_.each(in_values, function (value, key) {\n\t\t\t\tvar property = that.get(String(key), {\n\t\t\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t\t\t});\n\t\t\t\t// if key exists in set replace its value else insert a new key/value\n\t\t\t\tif (property) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty instanceof Property.ValueProperty ||\n\t\t\t\t\t\tproperty instanceof Property.StringProperty\n\t\t\t\t\t) {\n\t\t\t\t\t\tproperty.setValue(value);\n\t\t\t\t\t} else if (property instanceof BaseProperty && _.isObject(value)) {\n\t\t\t\t\t\tproperty._setValues(value, false, false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new TypeError(MSG.SET_VALUES_PATH_INVALID + key);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (value instanceof BaseProperty) {\n\t\t\t\t\t\tthat.insert(key, value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (in_typed) {\n\t\t\t\t\t\t\tthat.insert(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\t\tvalue.typeid || that._typeid,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tvalue.value,\n\t\t\t\t\t\t\t\t\tthat._getScope(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthat.insert(\n\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\tProperty.PropertyFactory._createProperty(\n\t\t\t\t\t\t\t\t\tthat._typeid,\n\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tthat._getScope(),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Sets multiple values in a map.\n\t *\n\t * See {@link MapProperty.setValues}\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @param {Bool} in_typed - Whether the values are typed/polymorphic.\n\t * @param {Bool} in_initial - Whether we are setting default/initial values or if the function is called directly\n\t * with the values to set.\n\t *\n\t * @override\n\t */\n\t_setValues(in_values, in_typed, in_initial) {\n\t\tif (in_initial) {\n\t\t\tthis.clear();\n\t\t}\n\n\t\tthis._setValuesInternal(in_values, in_typed);\n\t}\n\n\t/**\n\t * Sets multiple values in a map.\n\t *\n\t * @param {object} in_values - to assign to the collection\n\t * @throws If one of the path in in_values does not exist in this property\n\t * @throws If trying to set a value to a path that leads to a Property other than ValueProperty or StringProperty\n\t *\n\t * @override\n\t */\n\tsetValues(in_values) {\n\t\tvar checkoutView = this._getCheckoutView();\n\t\tif (checkoutView !== undefined) {\n\t\t\tcheckoutView.pushNotificationDelayScope();\n\t\t\tthis._setValues(in_values, false, false);\n\t\t\tcheckoutView.popNotificationDelayScope();\n\t\t} else {\n\t\t\tthis._setValues(in_values, false, false);\n\t\t}\n\t}\n\n\t/**\n\t * Returns an object with all the nested values contained in this property.\n\t *\n\t * @example\n\t * ```javascript\n\t * {\n\t * 'firstString': {\n\t * 'stringValue': 'test1'\n\t * },\n\t * 'secondString': {\n\t * 'stringValue': 'test2'\n\t * }\n\t * }\n\t */\n\tgetValues() {\n\t\tvar ids = this.getIds();\n\t\tvar result = {};\n\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\tvar child = this.get(ids[i]);\n\t\t\tif (child.isPrimitiveType()) {\n\t\t\t\tresult[ids[i]] = this.get(ids[i]).getValue();\n\t\t\t} else {\n\t\t\t\tresult[ids[i]] = child.getValues();\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns the path segment for a child\n\t *\n\t * @param {property-properties.BaseProperty} in_childNode - The child for which the path is returned\n\t *\n\t * @return {string} The path segment to resolve the child property under this property\n\t * @protected\n\t */\n\t_getPathSegmentForChildNode(in_childNode) {\n\t\treturn \"[\" + PathHelper.quotePathSegmentIfNeeded(in_childNode._id) + \"]\";\n\t}\n\n\t/**\n\t * Resolves a direct child node based on the given path segment\n\t *\n\t * @param {String} in_segment - The path segment to resolve\n\t * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n\t *\n\t * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n\t * @protected\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\treturn in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN\n\t\t\t? this._dynamicChildren[in_segment]\n\t\t\t: AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tin_segment,\n\t\t\t\t\tin_segmentType,\n\t\t\t );\n\t}\n\n\t/**\n\t * Inserts a property or value into the map\n\t *\n\t * Note: This will trigger an exception when this key already exists in the map. If you want to overwrite\n\t * existing entries you can use the set function.\n\t *\n\t * @param {string} in_key - The key under which the entry is added\n\t * @param {property-properties.Property} in_property - The property to insert\n\t * @throws If the property already exists\n\t * @throws If the property already has a parent\n\t * @throws If in_key is not a string\n\t * @throws If the property is a root property\n\t */\n\tinsert(in_key, in_property) {\n\t\tConsoleUtils.assert(_.isString(in_key), MSG.KEY_NOT_STRING + in_key);\n\t\tif (this._dynamicChildren[in_key] !== undefined) {\n\t\t\tthrow new Error(MSG.PROPERTY_ALREADY_EXISTS + in_key);\n\t\t}\n\t\tif (in_property instanceof BaseProperty) {\n\t\t\tin_property._validateInsertIn(this);\n\t\t\t// Set the ID of the entry, to make sure it corresponds to the used key\n\t\t\tin_property._setId(in_key);\n\n\t\t\t// Insert the entry into the collection\n\t\t\tthis._insert(in_key, in_property, true);\n\t\t} else {\n\t\t\tthrow new TypeError(MSG.NONVALUE_MAP_INSERT_PROP);\n\t\t}\n\t}\n\n\t/**\n\t * Removes the entry with the given key from the map\n\t *\n\t * @param {string} in_key - The key of the entry to remove from the map\n\t * @throws If trying to remove an entry that does not exist\n\t * @return {*} the item removed\n\t */\n\tremove(in_key) {\n\t\tvar item = this.get(in_key);\n\t\tthis._removeByKey(in_key, true);\n\t\treturn item;\n\t}\n\n\t/**\n\t * Sets the entry with the given key to the property passed in\n\t *\n\t * Note: this will overwrite an already existing value\n\t *\n\t * @param {string} in_key - The key under which the entry is stored\n\t * @param {property-properties.MapProperty~MapValueType} in_property - The property to store in the map\n\t * @throws If in_property is not a property\n\t * @throws If trying to insert a property that has a parent\n\t * @throws If in_key is not a string or a number\n\t */\n\tset(in_key, in_property) {\n\t\tthis._checkIsNotReadOnly(true);\n\t\tif (this._dynamicChildren[in_key] !== in_property) {\n\t\t\tif (this._containsPrimitiveTypes === false && in_property.getParent() !== undefined) {\n\t\t\t\tthrow new Error(MSG.INSERTED_ENTRY_WITH_PARENT);\n\t\t\t}\n\t\t\tif (this._dynamicChildren[in_key] !== undefined) {\n\t\t\t\tthis._removeByKey(in_key, false);\n\t\t\t}\n\t\t\t// Set the ID of the entry, to make sure it corresponds to the used key\n\t\t\tif (this._containsPrimitiveTypes === false) {\n\t\t\t\tin_property._setId(in_key);\n\t\t\t}\n\t\t\tthis._insert(in_key, in_property, false);\n\n\t\t\t// Make one final report\n\t\t\tthis._reportDirtinessToView();\n\t\t}\n\t}\n\n\t/**\n\t * Returns an Object with all the entries of the map.\n\t * Contrary ot .getValues, for Property Maps, this will return the Property, not an object with their nested values.\n\t * WARNING: This is a direct access to the internal data-structure and the collection MUST NOT be modified. It is\n\t * read only for fast access and iteration. Insertion and deletion MUST be done via the insert and remove functions\n\t * of this class.\n\t *\n\t * @return {Object} The map with all entries in the map.\n\t */\n\tgetEntriesReadOnly() {\n\t\treturn this._dynamicChildren;\n\t}\n\n\t/**\n\t * Returns the collection entry with the given key\n\t *\n\t * @param {string|array<string>} in_ids - key of the entry to return or an array of keys\n\t * if an array is passed, the .get function will be performed on each id in sequence\n\t * for example .get(['position','x']) is equivalent to .get('position').get('x').\n\t * If .get resolves to a ReferenceProperty, it will return the property that the ReferenceProperty\n\t * refers to.\n\t * @param {Object} in_options - parameter object\n\t * @param {property-properties.BaseProperty.REFERENCE_RESOLUTION} [in_options.referenceResolutionMode=ALWAYS]- -\n\t * How should this function behave during reference resolution?\n\t *\n\t * @return {property-properties.Property|*|undefined} The entry in the collection or undefined\n\t * if none could be found\n\t */\n\tget(in_ids, in_options) {\n\t\tif (_.isArray(in_ids)) {\n\t\t\t// Forward handling of arrays to the BaseProperty function\n\t\t\treturn AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);\n\t\t} else {\n\t\t\tin_options = in_options || {};\n\t\t\tin_options.referenceResolutionMode =\n\t\t\t\tin_options.referenceResolutionMode === undefined\n\t\t\t\t\t? BaseProperty.REFERENCE_RESOLUTION.ALWAYS\n\t\t\t\t\t: in_options.referenceResolutionMode;\n\n\t\t\tvar prop = this;\n\t\t\tswitch (in_ids) {\n\t\t\t\tcase PATH_TOKENS.ROOT: {\n\t\t\t\t\tprop = prop.getRoot();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase PATH_TOKENS.UP: {\n\t\t\t\t\tprop = prop.getParent();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase PATH_TOKENS.REF: {\n\t\t\t\t\tthrow new Error(MSG.NO_GET_DEREFERENCE_ONLY);\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tprop = prop._dynamicChildren[in_ids];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle automatic reference resolution\n\t\t\tif (in_options.referenceResolutionMode === BaseProperty.REFERENCE_RESOLUTION.ALWAYS) {\n\t\t\t\tif (prop instanceof Property.ReferenceProperty) {\n\t\t\t\t\tprop = prop.ref;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn prop;\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether an entry with the given name exists\n\t *\n\t * @param {string} in_id - Name of the property\n\t * @return {boolean} True if the property exists, otherwise false.\n\t */\n\thas(in_id) {\n\t\treturn this._dynamicChildren[in_id] !== undefined;\n\t}\n\n\t/**\n\t * Returns all entries of the map as an array.\n\t *\n\t * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n\t *\n\t * @return {Array.<property-properties.BaseProperty | *>} Array with all entries of the map. This array\n\t * is a shallow copy which can be modified by the caller without effects on the map.\n\t */\n\tgetAsArray() {\n\t\treturn _.values(this._dynamicChildren);\n\t}\n\n\t/**\n\t * Returns all keys found in the map\n\t *\n\t * NOTE: This function creates a copy and thus is less efficient as getEntriesReadOnly.\n\t *\n\t * @return {Array.<string>} The keys\n\t */\n\tgetIds() {\n\t\treturn Object.keys(this._dynamicChildren);\n\t}\n\n\t/**\n\t * Get the scope to which this property belongs to.\n\t * @return {string|undefined} The guid representing the scope in which the\n\t * map belongs to. If there is a workspace scope return it, else return the scope of this map.\n\t * @override\n\t * @private\n\t */\n\t_getScope() {\n\t\tvar scope = IndexedCollectionBaseProperty.prototype._getScope.call(this);\n\n\t\treturn scope !== undefined ? scope : this._scope;\n\t}\n\n\t/**\n\t * Deletes all values from the Map\n\t */\n\tclear() {\n\t\tvar that = this;\n\t\tthis.getIds().forEach(function (id) {\n\t\t\tthat.remove(id);\n\t\t});\n\t}\n}\n\nMapProperty.prototype._typeid = \"BaseProperty\";\nMapProperty.prototype._context = \"map\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"namedNodeProperty.d.ts","sourceRoot":"","sources":["../../src/properties/namedNodeProperty.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IACI;;;;;;;;;;OAUG;IACH,wBAEC;IAoBD;;;OAGG;IACH,YAAwC;CAC3C"}
1
+ {"version":3,"file":"namedNodeProperty.d.ts","sourceRoot":"","sources":["../../src/properties/namedNodeProperty.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IACC;;;;;;;;;;OAUG;IACH,wBAEC;IAoBD;;;OAGG;IACH,YAAwC;CACxC"}
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @fileoverview Definition of the named node property class
7
7
  */
8
- const { NamedProperty } = require('./namedProperty');
9
- const { NodeProperty } = require('./nodeProperty');
8
+ const { NamedProperty } = require("./namedProperty");
9
+ const { NodeProperty } = require("./nodeProperty");
10
10
  /**
11
11
  * A NamedNodeProperty is a NodeProperty that has a GUID which unique identifies the property object.
12
12
  * This makes it possible to store it in a set collection.
@@ -48,5 +48,5 @@ export class NamedNodeProperty extends NodeProperty {
48
48
  this.getUrn = NamedProperty.prototype.getUrn;
49
49
  }
50
50
  }
51
- NamedNodeProperty.prototype._typeid = 'NamedNodeProperty';
51
+ NamedNodeProperty.prototype._typeid = "NamedNodeProperty";
52
52
  //# sourceMappingURL=namedNodeProperty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"namedNodeProperty.js","sourceRoot":"","sources":["../../src/properties/namedNodeProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IAC/C;;;;;;;;;;OAUG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;QAGrB;;;;;;WAMG;QACH,UAAK,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC;QAEtC;;;;;;WAMG;QACH,YAAO,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC;QAE1C;;;WAGG;QACH,WAAM,GAAG,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC;IAxBxC,CAAC;CAyBJ;AAED,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the named node property class\n */\n\nconst { NamedProperty } = require('./namedProperty');\nconst { NodeProperty } = require('./nodeProperty');\n\n/**\n * A NamedNodeProperty is a NodeProperty that has a GUID which unique identifies the property object.\n * This makes it possible to store it in a set collection.\n */\nexport class NamedNodeProperty extends NodeProperty {\n /**\n * @param {object} in_params - List of parameters\n * @param {string} in_params.id - id of the property (null, if the GUID should be used for the ID)\n * @param {string} in_params.typeid - The type identifier\n *\n * @constructor\n * @protected\n * @extends property-properties.NodeProperty\n * @alias property-properties.NamedNodeProperty\n * @category Other Collections\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Returns a string identifying the property\n *\n * If an id has been explicitly set on this property we return that one, otherwise the GUID is used.\n *\n * @return {string} String identifying the property\n */\n getId = NamedProperty.prototype.getId;\n\n /**\n * Returns the GUID of this named property\n * A Guid is a unique identifier for a branch, commit or repository,\n * similar to a URN. Most functions in the API will us a URN but the\n * Guid is used to traverse the commit graph.\n * @return {string} The GUID\n */\n getGuid = NamedProperty.prototype.getGuid;\n\n /**\n * Return the URN for this named property\n * @return {string} The URN\n */\n getUrn = NamedProperty.prototype.getUrn;\n}\n\nNamedNodeProperty.prototype._typeid = 'NamedNodeProperty';\n"]}
1
+ {"version":3,"file":"namedNodeProperty.js","sourceRoot":"","sources":["../../src/properties/namedNodeProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IAClD;;;;;;;;;;OAUG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QAGlB;;;;;;WAMG;QACH,UAAK,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC;QAEtC;;;;;;WAMG;QACH,YAAO,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC;QAE1C;;;WAGG;QACH,WAAM,GAAG,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC;IAxBxC,CAAC;CAyBD;AAED,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the named node property class\n */\n\nconst { NamedProperty } = require(\"./namedProperty\");\nconst { NodeProperty } = require(\"./nodeProperty\");\n\n/**\n * A NamedNodeProperty is a NodeProperty that has a GUID which unique identifies the property object.\n * This makes it possible to store it in a set collection.\n */\nexport class NamedNodeProperty extends NodeProperty {\n\t/**\n\t * @param {object} in_params - List of parameters\n\t * @param {string} in_params.id - id of the property (null, if the GUID should be used for the ID)\n\t * @param {string} in_params.typeid - The type identifier\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.NodeProperty\n\t * @alias property-properties.NamedNodeProperty\n\t * @category Other Collections\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Returns a string identifying the property\n\t *\n\t * If an id has been explicitly set on this property we return that one, otherwise the GUID is used.\n\t *\n\t * @return {string} String identifying the property\n\t */\n\tgetId = NamedProperty.prototype.getId;\n\n\t/**\n\t * Returns the GUID of this named property\n\t * A Guid is a unique identifier for a branch, commit or repository,\n\t * similar to a URN. Most functions in the API will us a URN but the\n\t * Guid is used to traverse the commit graph.\n\t * @return {string} The GUID\n\t */\n\tgetGuid = NamedProperty.prototype.getGuid;\n\n\t/**\n\t * Return the URN for this named property\n\t * @return {string} The URN\n\t */\n\tgetUrn = NamedProperty.prototype.getUrn;\n}\n\nNamedNodeProperty.prototype._typeid = \"NamedNodeProperty\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"namedProperty.d.ts","sourceRoot":"","sources":["../../src/properties/namedProperty.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IACI;;;;;;;;;;OAUG;IACH,wBAEC;CAiCJ"}
1
+ {"version":3,"file":"namedProperty.d.ts","sourceRoot":"","sources":["../../src/properties/namedProperty.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IACC;;;;;;;;;;OAUG;IACH,wBAEC;CAmCD"}
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @fileoverview Definition of the named property class
7
7
  */
8
- const { ContainerProperty } = require('./containerProperty');
9
- const { BaseProperty } = require('./baseProperty');
8
+ const { ContainerProperty } = require("./containerProperty");
9
+ const { BaseProperty } = require("./baseProperty");
10
10
  /**
11
11
  * A NamedProperty has a URN which uniquely identifies the property object. This makes it possible to store it in a
12
12
  * set collection.
@@ -44,9 +44,11 @@ export class NamedProperty extends ContainerProperty {
44
44
  * @return {string} The GUID
45
45
  */
46
46
  getGuid() {
47
- var guid = this.get('guid', { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });
48
- return guid ? guid.getValue() : '';
47
+ var guid = this.get("guid", {
48
+ referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,
49
+ });
50
+ return guid ? guid.getValue() : "";
49
51
  }
50
52
  }
51
- NamedProperty.prototype._typeid = 'NamedProperty';
53
+ NamedProperty.prototype._typeid = "NamedProperty";
52
54
  //# sourceMappingURL=namedProperty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"namedProperty.js","sourceRoot":"","sources":["../../src/properties/namedProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAC7D,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAChD;;;;;;;;;;OAUG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAED;;;;;;OAMG;IACH,KAAK;QACD,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;IAED;;;;;;OAMG;IACH,OAAO;QACH,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,uBAAuB,EAAE,YAAY,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC;QAClG,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,CAAC;CAUJ;AACD,aAAa,CAAC,SAAS,CAAC,OAAO,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the named property class\n */\n\nconst { ContainerProperty } = require('./containerProperty');\nconst { BaseProperty } = require('./baseProperty');\n\n/**\n * A NamedProperty has a URN which uniquely identifies the property object. This makes it possible to store it in a\n * set collection.\n */\nexport class NamedProperty extends ContainerProperty {\n /**\n * @param {object} in_params - List of parameters\n * @param {string} in_params.id - id of the property (null, if the GUID should be used for the ID)\n * @param {string} in_params.typeid - The type identifier\n *\n * @constructor\n * @protected\n * @extends property-properties.ContainerProperty\n * @alias property-properties.NamedProperty\n * @category Properties\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Returns a string identifying the property\n *\n * If an id has been explicitly set on this property we return that one, otherwise the GUID is used.\n *\n * @return {string} String identifying the property\n */\n getId() {\n return this._id !== null ? this._id : this.getGuid();\n }\n\n /**\n * Returns the GUID of this named property\n * A Guid is a unique identifier for a branch, commit or repository,\n * similar to a URN. Most functions in the API will us a URN but the\n * Guid is used to traverse the commit graph.\n * @return {string} The GUID\n */\n getGuid() {\n var guid = this.get('guid', { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER });\n return guid ? guid.getValue() : '';\n }\n\n // THIS IS DISABLED FOR THE MOMENT, UNTIL WE BETTER UNDERSTAND HOW REFERENCES WORK IN FLUID\n /**\n * Return the URN for this named property\n * @return {string} The URN\n */\n /* NamedProperty.prototype.getUrn = function() {\n\n }; */\n}\nNamedProperty.prototype._typeid = 'NamedProperty';\n"]}
1
+ {"version":3,"file":"namedProperty.js","sourceRoot":"","sources":["../../src/properties/namedProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AAEH,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAC7D,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IACnD;;;;;;;;;;OAUG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;IAClB,CAAC;IAED;;;;;;OAMG;IACH,KAAK;QACJ,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACtD,CAAC;IAED;;;;;;OAMG;IACH,OAAO;QACN,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YAC3B,uBAAuB,EAAE,YAAY,CAAC,oBAAoB,CAAC,KAAK;SAChE,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,CAAC;CAUD;AACD,aAAa,CAAC,SAAS,CAAC,OAAO,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Definition of the named property class\n */\n\nconst { ContainerProperty } = require(\"./containerProperty\");\nconst { BaseProperty } = require(\"./baseProperty\");\n\n/**\n * A NamedProperty has a URN which uniquely identifies the property object. This makes it possible to store it in a\n * set collection.\n */\nexport class NamedProperty extends ContainerProperty {\n\t/**\n\t * @param {object} in_params - List of parameters\n\t * @param {string} in_params.id - id of the property (null, if the GUID should be used for the ID)\n\t * @param {string} in_params.typeid - The type identifier\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ContainerProperty\n\t * @alias property-properties.NamedProperty\n\t * @category Properties\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Returns a string identifying the property\n\t *\n\t * If an id has been explicitly set on this property we return that one, otherwise the GUID is used.\n\t *\n\t * @return {string} String identifying the property\n\t */\n\tgetId() {\n\t\treturn this._id !== null ? this._id : this.getGuid();\n\t}\n\n\t/**\n\t * Returns the GUID of this named property\n\t * A Guid is a unique identifier for a branch, commit or repository,\n\t * similar to a URN. Most functions in the API will us a URN but the\n\t * Guid is used to traverse the commit graph.\n\t * @return {string} The GUID\n\t */\n\tgetGuid() {\n\t\tvar guid = this.get(\"guid\", {\n\t\t\treferenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,\n\t\t});\n\t\treturn guid ? guid.getValue() : \"\";\n\t}\n\n\t// THIS IS DISABLED FOR THE MOMENT, UNTIL WE BETTER UNDERSTAND HOW REFERENCES WORK IN FLUID\n\t/**\n\t * Return the URN for this named property\n\t * @return {string} The URN\n\t */\n\t/* NamedProperty.prototype.getUrn = function() {\n\n }; */\n}\nNamedProperty.prototype._typeid = \"NamedProperty\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeProperty.d.ts","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;CAwBC"}
1
+ {"version":3,"file":"nodeProperty.d.ts","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;CA0BC"}
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @fileoverview This file contains the implementation of the NodeProperty class
7
7
  */
8
- const { ContainerProperty } = require('./containerProperty');
8
+ const { ContainerProperty } = require("./containerProperty");
9
9
  /**
10
10
  * A property object that allows to add child properties dynamically.
11
11
  */
@@ -26,11 +26,13 @@ export class NodeProperty extends ContainerProperty {
26
26
  /**
27
27
  * @inheritdoc
28
28
  */
29
- isDynamic() { return true; }
29
+ isDynamic() {
30
+ return true;
31
+ }
30
32
  /**
31
33
  * @inheritdoc
32
34
  */
33
35
  _validateInsert(in_id, in_property) { }
34
36
  }
35
- NodeProperty.prototype._typeid = 'NodeProperty';
37
+ NodeProperty.prototype._typeid = "NodeProperty";
36
38
  //# sourceMappingURL=nodeProperty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeProperty.js","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAC/C;;;;;;;;OAQG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,SAAS,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;IAE5B;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,WAAW,IAAI,CAAC;CAC1C;AACD,YAAY,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview This file contains the implementation of the NodeProperty class\n */\nconst { ContainerProperty } = require('./containerProperty');\n\n/**\n * A property object that allows to add child properties dynamically.\n */\nexport class NodeProperty extends ContainerProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ContainerProperty\n * @alias property-properties.NodeProperty\n * @category Other Collections\n */\n constructor(in_params) {\n super(in_params);\n this._dynamicChildren = {};\n }\n\n /**\n * @inheritdoc\n */\n isDynamic() { return true; }\n\n /**\n * @inheritdoc\n */\n _validateInsert(in_id, in_property) { }\n}\nNodeProperty.prototype._typeid = 'NodeProperty';\n"]}
1
+ {"version":3,"file":"nodeProperty.js","sourceRoot":"","sources":["../../src/properties/nodeProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAClD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,SAAS;QACR,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,WAAW,IAAG,CAAC;CACtC;AACD,YAAY,CAAC,SAAS,CAAC,OAAO,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview This file contains the implementation of the NodeProperty class\n */\nconst { ContainerProperty } = require(\"./containerProperty\");\n\n/**\n * A property object that allows to add child properties dynamically.\n */\nexport class NodeProperty extends ContainerProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ContainerProperty\n\t * @alias property-properties.NodeProperty\n\t * @category Other Collections\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t\tthis._dynamicChildren = {};\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tisDynamic() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_validateInsert(in_id, in_property) {}\n}\nNodeProperty.prototype._typeid = \"NodeProperty\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"primitiveTypeCasts.d.ts","sourceRoot":"","sources":["../../src/properties/primitiveTypeCasts.js"],"names":[],"mappings":";IAkDY,6DAWP;;;;IA8BM,4DAWN;;;;;;IA0CO,0CAEP;IAOQ,6CAER"}
1
+ {"version":3,"file":"primitiveTypeCasts.d.ts","sourceRoot":"","sources":["../../src/properties/primitiveTypeCasts.js"],"names":[],"mappings":";IAkDS,6DAWP;;;;IA8BM,4DAWN;;;;;;IA0CO,0CAEP;IAOQ,6CAER"}
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @fileoverview Helper functions to cast a JavaScript type to a value that is compatible with a given primitive type
7
7
  */
8
- const _ = require('lodash');
9
- const { MSG } = require('@fluid-experimental/property-common').constants;
10
- const { Int64, Uint64 } = require('@fluid-experimental/property-common');
8
+ const _ = require("lodash");
9
+ const { MSG } = require("@fluid-experimental/property-common").constants;
10
+ const { Int64, Uint64 } = require("@fluid-experimental/property-common");
11
11
  var castArrays = {
12
12
  Uint32: new Uint32Array(1),
13
13
  Uint16: new Uint16Array(1),
@@ -49,13 +49,13 @@ const _castFunctors = {
49
49
  if (in_value instanceof Uint64) {
50
50
  return in_value;
51
51
  }
52
- if (typeof in_value === 'string') {
52
+ if (typeof in_value === "string") {
53
53
  return Uint64.fromString(in_value, in_radix);
54
54
  }
55
- if (typeof in_value === 'number') {
55
+ if (typeof in_value === "number") {
56
56
  return Uint64.fromString(String(in_value), in_radix);
57
57
  }
58
- throw new Error(MSG.INT_64_NON_INT64_TYPE + ' , value: ' + in_value);
58
+ throw new Error(MSG.INT_64_NON_INT64_TYPE + " , value: " + in_value);
59
59
  },
60
60
  /**
61
61
  * Casts the input value to a Uint32
@@ -90,13 +90,13 @@ const _castFunctors = {
90
90
  if (in_value instanceof Int64) {
91
91
  return in_value;
92
92
  }
93
- if (typeof in_value === 'string') {
93
+ if (typeof in_value === "string") {
94
94
  return Int64.fromString(in_value, in_radix);
95
95
  }
96
- if (typeof in_value === 'number') {
96
+ if (typeof in_value === "number") {
97
97
  return Int64.fromString(String(in_value), in_radix);
98
98
  }
99
- throw new Error(MSG.INT_64_NON_INT64_TYPE + ' , value: ' + in_value);
99
+ throw new Error(MSG.INT_64_NON_INT64_TYPE + " , value: " + in_value);
100
100
  },
101
101
  /**
102
102
  * Casts the input value to a Int32
@@ -1 +1 @@
1
- {"version":3,"file":"primitiveTypeCasts.js","sourceRoot":"","sources":["../../src/properties/primitiveTypeCasts.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAEzE,IAAI,UAAU,GAAG;IACb,MAAM,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC;IAC1B,MAAM,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC;IAC1B,KAAK,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC;IACxB,KAAK,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC;IACxB,KAAK,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC;IACtB,OAAO,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC;CAC/B,CAAC;AAEF;;;;;;;;GAQG;AACH,IAAI,kBAAkB,GAAG,UAAS,QAAQ,EAAE,QAAQ;IAChD,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC;IACvB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,aAAa,GAAG;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GAAG,QAAQ,CAAC,CAAC;IACzE,CAAC;IACD;;;;;OAKG;IACH,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC;IAC3D;;;;;OAKG;IACH,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC;IAC3D;;;;;OAKG;IACH,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC;IACzD;;;;;OAKG;IACH,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC;IAC/D;;;;;OAKG;IACH,OAAO,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC;IAC/D;;;;;OAKG;IACH,MAAM,EAAE,UAAS,QAAQ;QACrB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IACD;;;;;OAKG;IACH,OAAO,EAAE,UAAS,QAAQ;QACtB,OAAO,CAAC,CAAC,QAAQ,CAAC;IACtB,CAAC;CACJ,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions to cast a JavaScript type to a value that is compatible with a given primitive type\n */\nconst _ = require('lodash');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst { Int64, Uint64 } = require('@fluid-experimental/property-common');\n\nvar castArrays = {\n Uint32: new Uint32Array(1),\n Uint16: new Uint16Array(1),\n Uint8: new Uint8Array(1),\n Int32: new Int32Array(1),\n Int16: new Int16Array(1),\n Int8: new Int8Array(1),\n Float32: new Float32Array(1),\n Float64: new Float64Array(1),\n};\n\n/**\n * Performs a cast of a value by assigning it into the given data array and returning the resulting value. The\n * result is a native JavaScript datatype, that is compatible with the supplied typed array.\n *\n * @param {TypedArray} in_array - The data array to use for the cast\n * @param {number|string|boolean} in_value - The value to use in the cast\n * @return {number|string|boolean} The casted value\n * @private\n */\nvar _simpleCastFunctor = function(in_array, in_value) {\n in_array[0] = in_value;\n return in_array[0];\n};\n\n/**\n * Helper functions to cast the input value to the given type\n * @protected\n * @alias property-properties._castFunctors\n */\nconst _castFunctors = {\n /**\n * Casts the input value to a Uint64\n * @param {number} in_value - The value to use in the cast\n * @param {number} [in_radix = 10] - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above in_value if it is a string.\n * @return {number} The casted value\n * @protected\n */\n Uint64: function(in_value, in_radix) {\n if (in_value instanceof Uint64) {\n return in_value;\n }\n if (typeof in_value === 'string') {\n return Uint64.fromString(in_value, in_radix);\n }\n if (typeof in_value === 'number') {\n return Uint64.fromString(String(in_value), in_radix);\n }\n throw new Error(MSG.INT_64_NON_INT64_TYPE + ' , value: ' + in_value);\n },\n /**\n * Casts the input value to a Uint32\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Uint32: _simpleCastFunctor.bind(undefined, castArrays.Uint32),\n /**\n * Casts the input value to a Uint16\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Uint16: _simpleCastFunctor.bind(undefined, castArrays.Uint16),\n /**\n * Casts the input value to a Uint8\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Uint8: _simpleCastFunctor.bind(undefined, castArrays.Uint8),\n /**\n * Casts the input value to a Int64\n * @param {number} in_value - The value to use in the cast\n * @param {number} [in_radix = 10] - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above in_value if it is a string.\n * @return {number} The casted value\n * @protected\n */\n Int64: function(in_value, in_radix) {\n if (in_value instanceof Int64) {\n return in_value;\n }\n if (typeof in_value === 'string') {\n return Int64.fromString(in_value, in_radix);\n }\n if (typeof in_value === 'number') {\n return Int64.fromString(String(in_value), in_radix);\n }\n throw new Error(MSG.INT_64_NON_INT64_TYPE + ' , value: ' + in_value);\n },\n /**\n * Casts the input value to a Int32\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Int32: _simpleCastFunctor.bind(undefined, castArrays.Int32),\n /**\n * Casts the input value to a Int16\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Int16: _simpleCastFunctor.bind(undefined, castArrays.Int16),\n /**\n * Casts the input value to a Int8\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Int8: _simpleCastFunctor.bind(undefined, castArrays.Int8),\n /**\n * Casts the input value to a Float32\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Float32: _simpleCastFunctor.bind(undefined, castArrays.Float32),\n /**\n * Casts the input value to a Float64\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n Float64: _simpleCastFunctor.bind(undefined, castArrays.Float64),\n /**\n * Casts the input value to a String\n * @param {number} in_value - The value to use in the cast\n * @return {number} The casted value\n * @protected\n */\n String: function(in_value) {\n return String(in_value);\n },\n /**\n * Casts the input value to a Boolean value\n * @param {boolean} in_value - The value to use in the cast\n * @return {boolean} The casted value\n * @protected\n */\n Boolean: function(in_value) {\n return !!in_value;\n },\n};\n\nexport { _castFunctors };\n"]}
1
+ {"version":3,"file":"primitiveTypeCasts.js","sourceRoot":"","sources":["../../src/properties/primitiveTypeCasts.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;GAEG;AACH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AAEzE,IAAI,UAAU,GAAG;IAChB,MAAM,EAAE,IAAI,WAAW,CAAC,CAAC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E,UAAU,QAAQ;QAC1B,OAAO,CAAC,CAAC,QAAQ,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/**\n * @fileoverview Helper functions to cast a JavaScript type to a value that is compatible with a given primitive type\n */\nconst _ = require(\"lodash\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst { Int64, Uint64 } = require(\"@fluid-experimental/property-common\");\n\nvar castArrays = {\n\tUint32: new Uint32Array(1),\n\tUint16: new Uint16Array(1),\n\tUint8: new Uint8Array(1),\n\tInt32: new Int32Array(1),\n\tInt16: new Int16Array(1),\n\tInt8: new Int8Array(1),\n\tFloat32: new Float32Array(1),\n\tFloat64: new Float64Array(1),\n};\n\n/**\n * Performs a cast of a value by assigning it into the given data array and returning the resulting value. The\n * result is a native JavaScript datatype, that is compatible with the supplied typed array.\n *\n * @param {TypedArray} in_array - The data array to use for the cast\n * @param {number|string|boolean} in_value - The value to use in the cast\n * @return {number|string|boolean} The casted value\n * @private\n */\nvar _simpleCastFunctor = function (in_array, in_value) {\n\tin_array[0] = in_value;\n\treturn in_array[0];\n};\n\n/**\n * Helper functions to cast the input value to the given type\n * @protected\n * @alias property-properties._castFunctors\n */\nconst _castFunctors = {\n\t/**\n\t * Casts the input value to a Uint64\n\t * @param {number} in_value - The value to use in the cast\n\t * @param {number} [in_radix = 10] - An integer between 2 and 36 that represents the\n\t * radix (the base in mathematical numeral systems) of the above in_value if it is a string.\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tUint64: function (in_value, in_radix) {\n\t\tif (in_value instanceof Uint64) {\n\t\t\treturn in_value;\n\t\t}\n\t\tif (typeof in_value === \"string\") {\n\t\t\treturn Uint64.fromString(in_value, in_radix);\n\t\t}\n\t\tif (typeof in_value === \"number\") {\n\t\t\treturn Uint64.fromString(String(in_value), in_radix);\n\t\t}\n\t\tthrow new Error(MSG.INT_64_NON_INT64_TYPE + \" , value: \" + in_value);\n\t},\n\t/**\n\t * Casts the input value to a Uint32\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tUint32: _simpleCastFunctor.bind(undefined, castArrays.Uint32),\n\t/**\n\t * Casts the input value to a Uint16\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tUint16: _simpleCastFunctor.bind(undefined, castArrays.Uint16),\n\t/**\n\t * Casts the input value to a Uint8\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tUint8: _simpleCastFunctor.bind(undefined, castArrays.Uint8),\n\t/**\n\t * Casts the input value to a Int64\n\t * @param {number} in_value - The value to use in the cast\n\t * @param {number} [in_radix = 10] - An integer between 2 and 36 that represents the\n\t * radix (the base in mathematical numeral systems) of the above in_value if it is a string.\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tInt64: function (in_value, in_radix) {\n\t\tif (in_value instanceof Int64) {\n\t\t\treturn in_value;\n\t\t}\n\t\tif (typeof in_value === \"string\") {\n\t\t\treturn Int64.fromString(in_value, in_radix);\n\t\t}\n\t\tif (typeof in_value === \"number\") {\n\t\t\treturn Int64.fromString(String(in_value), in_radix);\n\t\t}\n\t\tthrow new Error(MSG.INT_64_NON_INT64_TYPE + \" , value: \" + in_value);\n\t},\n\t/**\n\t * Casts the input value to a Int32\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tInt32: _simpleCastFunctor.bind(undefined, castArrays.Int32),\n\t/**\n\t * Casts the input value to a Int16\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tInt16: _simpleCastFunctor.bind(undefined, castArrays.Int16),\n\t/**\n\t * Casts the input value to a Int8\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tInt8: _simpleCastFunctor.bind(undefined, castArrays.Int8),\n\t/**\n\t * Casts the input value to a Float32\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tFloat32: _simpleCastFunctor.bind(undefined, castArrays.Float32),\n\t/**\n\t * Casts the input value to a Float64\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tFloat64: _simpleCastFunctor.bind(undefined, castArrays.Float64),\n\t/**\n\t * Casts the input value to a String\n\t * @param {number} in_value - The value to use in the cast\n\t * @return {number} The casted value\n\t * @protected\n\t */\n\tString: function (in_value) {\n\t\treturn String(in_value);\n\t},\n\t/**\n\t * Casts the input value to a Boolean value\n\t * @param {boolean} in_value - The value to use in the cast\n\t * @return {boolean} The casted value\n\t * @protected\n\t */\n\tBoolean: function (in_value) {\n\t\treturn !!in_value;\n\t},\n};\n\nexport { _castFunctors };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"referenceArrayProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceArrayProperty.js"],"names":[],"mappings":"AAgBA;;GAEG;AACH;IA6MI;;;;;;;;;;;OAWG;IACH,uEAJa,MAAM,MAAM,CAAC,CAcxB;IArNF;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAoCD;;;;;;OAMG;IACH,8BAHW,MAAM,GACJ,OAAO,CAKnB;CA8JJ"}
1
+ {"version":3,"file":"referenceArrayProperty.d.ts","sourceRoot":"","sources":["../../src/properties/referenceArrayProperty.js"],"names":[],"mappings":"AAgBA;;GAEG;AACH;IA+NC;;;;;;;;;;;OAWG;IACH,uEAJa,MAAM,MAAM,CAAC,CAcxB;IAvOF;;;;;;;OAOG;IACH,4BAFa,MAAM,CAIlB;IAoCD;;;;;;OAMG;IACH,8BAHW,MAAM,GACJ,OAAO,CAOnB;CA8KD"}
@@ -5,14 +5,14 @@
5
5
  /**
6
6
  * @fileoverview Definition of the reference array property class
7
7
  */
8
- const { PathHelper, TypeIdHelper } = require('@fluid-experimental/property-changeset');
9
- const { MSG } = require('@fluid-experimental/property-common').constants;
10
- const { UniversalDataArray, ConsoleUtils } = require('@fluid-experimental/property-common');
11
- const _ = require('lodash');
12
- const { AbstractStaticCollectionProperty } = require('./abstractStaticCollectionProperty');
13
- const { BaseProperty } = require('./baseProperty');
14
- const { ReferenceProperty } = require('./referenceProperty');
15
- const { ValueArrayProperty } = require('./valueArrayProperty');
8
+ const { PathHelper, TypeIdHelper } = require("@fluid-experimental/property-changeset");
9
+ const { MSG } = require("@fluid-experimental/property-common").constants;
10
+ const { UniversalDataArray, ConsoleUtils } = require("@fluid-experimental/property-common");
11
+ const _ = require("lodash");
12
+ const { AbstractStaticCollectionProperty } = require("./abstractStaticCollectionProperty");
13
+ const { BaseProperty } = require("./baseProperty");
14
+ const { ReferenceProperty } = require("./referenceProperty");
15
+ const { ValueArrayProperty } = require("./valueArrayProperty");
16
16
  /**
17
17
  * An ArrayProperty which stores reference values
18
18
  */
@@ -57,16 +57,16 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
57
57
  get(in_ids, in_options) {
58
58
  in_options = in_options || {};
59
59
  in_options.referenceResolutionMode =
60
- in_options.referenceResolutionMode === undefined ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS :
61
- in_options.referenceResolutionMode;
60
+ in_options.referenceResolutionMode === undefined
61
+ ? BaseProperty.REFERENCE_RESOLUTION.ALWAYS
62
+ : in_options.referenceResolutionMode;
62
63
  if (_.isArray(in_ids)) {
63
64
  // Forward handling of arrays to the AbstractStaticCollectionProperty function
64
65
  return AbstractStaticCollectionProperty.prototype.get.call(this, in_ids, in_options);
65
66
  }
66
67
  else {
67
68
  var value = this._dataArrayRef.getValue(in_ids);
68
- if (value === undefined ||
69
- value === '') {
69
+ if (value === undefined || value === "") {
70
70
  return undefined;
71
71
  }
72
72
  return this.getParent().resolvePath(value, in_options);
@@ -80,8 +80,8 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
80
80
  * @returns {boolean} True if the reference is valid, otherwise false.
81
81
  */
82
82
  isReferenceValid(in_position) {
83
- return ValueArrayProperty.prototype.get.call(this, in_position) === '' ||
84
- this.get(in_position) !== undefined;
83
+ return (ValueArrayProperty.prototype.get.call(this, in_position) === "" ||
84
+ this.get(in_position) !== undefined);
85
85
  }
86
86
  /**
87
87
  * Sets the range in the array to point to the given property objects or to be equal to the given paths
@@ -95,7 +95,7 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
95
95
  * @throws If one of the items in in_array is defined, but is not a property or a string.
96
96
  */
97
97
  setRange(in_offset, in_array) {
98
- var arr = ReferenceArrayProperty._convertInputToPaths(in_array, 'setRange');
98
+ var arr = ReferenceArrayProperty._convertInputToPaths(in_array, "setRange");
99
99
  ValueArrayProperty.prototype.setRange.call(this, in_offset, arr);
100
100
  }
101
101
  /**
@@ -110,7 +110,7 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
110
110
  * @throws If one of the items in in_array is defined, but is not a property or a string.
111
111
  */
112
112
  insertRange(in_offset, in_array) {
113
- var arr = ReferenceArrayProperty._convertInputToPaths(in_array, 'insertRange');
113
+ var arr = ReferenceArrayProperty._convertInputToPaths(in_array, "insertRange");
114
114
  ValueArrayProperty.prototype.insertRange.call(this, in_offset, arr);
115
115
  }
116
116
  /**
@@ -173,9 +173,13 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
173
173
  * @returns {Array<String>} an array containing the values removed (string paths)
174
174
  */
175
175
  removeRange(in_offset, in_deleteCount) {
176
- ConsoleUtils.assert(_.isNumber(in_offset), MSG.NOT_NUMBER + 'in_offset, method: ArrayProperty.removeRange or .remove');
177
- ConsoleUtils.assert(_.isNumber(in_deleteCount), MSG.NOT_NUMBER + 'in_deleteCount, method: ArrayProperty.removeRange or .remove');
178
- ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0, MSG.REMOVE_OUT_OF_BOUNDS + 'Cannot remove ' + in_deleteCount + ' items starting at index ' + in_offset);
176
+ ConsoleUtils.assert(_.isNumber(in_offset), MSG.NOT_NUMBER + "in_offset, method: ArrayProperty.removeRange or .remove");
177
+ ConsoleUtils.assert(_.isNumber(in_deleteCount), MSG.NOT_NUMBER + "in_deleteCount, method: ArrayProperty.removeRange or .remove");
178
+ ConsoleUtils.assert(in_offset + in_deleteCount < this.length + 1 && in_offset >= 0 && in_deleteCount > 0, MSG.REMOVE_OUT_OF_BOUNDS +
179
+ "Cannot remove " +
180
+ in_deleteCount +
181
+ " items starting at index " +
182
+ in_offset);
179
183
  var result = [];
180
184
  for (var i = in_offset; i < in_offset + in_deleteCount; i++) {
181
185
  result.push(this.getValue(i));
@@ -191,9 +195,11 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
191
195
  _resolvePathSegment(in_segment, in_segmentType) {
192
196
  // Array tokens are automatically resolved
193
197
  return in_segmentType === PathHelper.TOKEN_TYPES.ARRAY_TOKEN
194
- ? this.get(in_segment, { referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER })
195
- // Everything else is handled by the implementation in the base property
196
- : AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(this, in_segment, in_segmentType);
198
+ ? this.get(in_segment, {
199
+ referenceResolutionMode: BaseProperty.REFERENCE_RESOLUTION.NEVER,
200
+ })
201
+ : // Everything else is handled by the implementation in the base property
202
+ AbstractStaticCollectionProperty.prototype._resolvePathSegment.call(this, in_segment, in_segmentType);
197
203
  }
198
204
  /**
199
205
  * Creates and initializes the data array
@@ -202,7 +208,7 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
202
208
  _dataArrayCreate(in_length) {
203
209
  this._dataArrayRef = new UniversalDataArray(in_length);
204
210
  for (var i = 0; i < in_length; i++) {
205
- this._dataArraySetValue(i, '');
211
+ this._dataArraySetValue(i, "");
206
212
  }
207
213
  }
208
214
  }
@@ -220,7 +226,7 @@ export class ReferenceArrayProperty extends ValueArrayProperty {
220
226
  */
221
227
  ReferenceArrayProperty._convertInputToPaths = function (in_array, in_callerName) {
222
228
  if (!_.isArray(in_array)) {
223
- throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'ReferenceArrayProperty.' + in_callerName);
229
+ throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + "ReferenceArrayProperty." + in_callerName);
224
230
  }
225
231
  var len = in_array.length;
226
232
  var arr = new Array(len);
@@ -229,5 +235,5 @@ ReferenceArrayProperty._convertInputToPaths = function (in_array, in_callerName)
229
235
  }
230
236
  return arr;
231
237
  };
232
- ReferenceArrayProperty.prototype._typeid = 'Reference';
238
+ ReferenceArrayProperty.prototype._typeid = "Reference";
233
239
  //# sourceMappingURL=referenceArrayProperty.js.map