@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
@@ -6,12 +6,12 @@
6
6
  /**
7
7
  * @fileoverview In this file, we will test the functions of the property factory.
8
8
  */
9
- const _ = require('lodash');
10
- const { ChangeSet } = require('@fluid-experimental/property-changeset');
11
- const { Int64, Uint64 } = require('@fluid-experimental/property-common');
12
- const { PropertyFactory } = require('..');
9
+ const _ = require("lodash");
10
+ const { ChangeSet } = require("@fluid-experimental/property-changeset");
11
+ const { Int64, Uint64 } = require("@fluid-experimental/property-common");
12
+ const { PropertyFactory } = require("..");
13
13
  const deepCopy = _.cloneDeep;
14
- describe('Reversible ChangeSets', function () {
14
+ describe("Reversible ChangeSets", function () {
15
15
  var testRevAndInvCS = function (initialProperty, modificationFunction, expectedRevCS, expectedAfterCS, expectedInverseCS) {
16
16
  var initialChangeSet = new ChangeSet(initialProperty._serialize(false));
17
17
  initialChangeSet.setIsNormalized(true);
@@ -60,118 +60,123 @@ describe('Reversible ChangeSets', function () {
60
60
  };
61
61
  before(function () {
62
62
  var TaskSubjectParentTemplate = {
63
- typeid: 'autodesk.tests:ChangeSetApplyAfterTask.parentTemplate-1.0.0',
63
+ typeid: "autodesk.tests:ChangeSetApplyAfterTask.parentTemplate-1.0.0",
64
64
  properties: [
65
- { id: 'directMember', typeid: 'autodesk.tests:ChangeSetApplyAfterTask.memberTemplate-1.0.0' },
66
65
  {
67
- id: 'nested', properties: [
68
- { id: 'member', typeid: 'autodesk.tests:ChangeSetApplyAfterTask.nestedTemplate-1.0.0' },
66
+ id: "directMember",
67
+ typeid: "autodesk.tests:ChangeSetApplyAfterTask.memberTemplate-1.0.0",
68
+ },
69
+ {
70
+ id: "nested",
71
+ properties: [
72
+ {
73
+ id: "member",
74
+ typeid: "autodesk.tests:ChangeSetApplyAfterTask.nestedTemplate-1.0.0",
75
+ },
69
76
  ],
70
77
  },
71
78
  ],
72
79
  };
73
80
  var TaskSubjectMemberTemplate = {
74
- typeid: 'autodesk.tests:ChangeSetApplyAfterTask.memberTemplate-1.0.0',
81
+ typeid: "autodesk.tests:ChangeSetApplyAfterTask.memberTemplate-1.0.0",
75
82
  properties: [
76
- { id: 'progress', typeid: 'Uint32' },
77
- { id: 'timeRemaining', typeid: 'Uint32' },
83
+ { id: "progress", typeid: "Uint32" },
84
+ { id: "timeRemaining", typeid: "Uint32" },
78
85
  ],
79
86
  };
80
87
  var TaskSubjectTestTemplate = {
81
- typeid: 'autodesk.tests:ChangeSetApplyAfterTask.nodeTemplate-1.0.0',
88
+ typeid: "autodesk.tests:ChangeSetApplyAfterTask.nodeTemplate-1.0.0",
82
89
  properties: [
83
- { id: 'result', typeid: 'NodeProperty' },
84
- { id: 'integer', typeid: 'Uint32' },
90
+ { id: "result", typeid: "NodeProperty" },
91
+ { id: "integer", typeid: "Uint32" },
85
92
  ],
86
93
  };
87
94
  // Register the templates from the discussion document
88
95
  var Vec3Template = {
89
- typeid: 'autodesk.test:vector3-1.0.0',
96
+ typeid: "autodesk.test:vector3-1.0.0",
90
97
  properties: [
91
- { id: 'x', typeid: 'Float32' },
92
- { id: 'y', typeid: 'Float32' },
93
- { id: 'z', typeid: 'Float32' },
98
+ { id: "x", typeid: "Float32" },
99
+ { id: "y", typeid: "Float32" },
100
+ { id: "z", typeid: "Float32" },
94
101
  ],
95
102
  };
96
103
  var Point2DTemplate = {
97
- typeid: 'autodesk.test:point2d-1.0.0',
104
+ typeid: "autodesk.test:point2d-1.0.0",
98
105
  properties: [
99
106
  {
100
- id: 'position', properties: [
101
- { id: 'x', typeid: 'Float32' },
102
- { id: 'y', typeid: 'Float32' },
107
+ id: "position",
108
+ properties: [
109
+ { id: "x", typeid: "Float32" },
110
+ { id: "y", typeid: "Float32" },
103
111
  ],
104
112
  },
105
- { id: 'normal', typeid: 'autodesk.test:vector3-1.0.0' },
106
- { id: 'neighbours', typeid: 'autodesk.test:vector3-1.0.0', context: 'map' },
107
- { id: 'temperature', typeid: 'Float32' },
113
+ { id: "normal", typeid: "autodesk.test:vector3-1.0.0" },
114
+ { id: "neighbours", typeid: "autodesk.test:vector3-1.0.0", context: "map" },
115
+ { id: "temperature", typeid: "Float32" },
108
116
  ],
109
117
  };
110
118
  var TestArrayFloat32 = {
111
- typeid: 'autodesk.test:test.arrayfloat32-1.0.0',
112
- properties: [
113
- { id: 'data', typeid: 'Float32', context: 'array' },
114
- ],
119
+ typeid: "autodesk.test:test.arrayfloat32-1.0.0",
120
+ properties: [{ id: "data", typeid: "Float32", context: "array" }],
115
121
  };
116
122
  var SimpleStringTestPropertyTemplate = {
117
- typeid: 'autodesk.tests:DataStringTestProperty-1.0.0',
118
- properties: [
119
- { id: 'data', typeid: 'String' },
120
- ],
123
+ typeid: "autodesk.tests:DataStringTestProperty-1.0.0",
124
+ properties: [{ id: "data", typeid: "String" }],
121
125
  };
122
126
  var SimpleRefTestPropertyTemplate = {
123
- typeid: 'autodesk.tests:DataRefTestProperty-1.0.0',
124
- properties: [
125
- { id: 'data', typeid: 'Reference' },
126
- ],
127
+ typeid: "autodesk.tests:DataRefTestProperty-1.0.0",
128
+ properties: [{ id: "data", typeid: "Reference" }],
127
129
  };
128
130
  var SimpleMapTestPropertyTemplate = {
129
- typeid: 'autodesk.tests:MapTestPropertyID-1.0.0',
130
- properties: [
131
- { id: 'data', typeid: 'Float32', context: 'map' },
132
- ],
131
+ typeid: "autodesk.tests:MapTestPropertyID-1.0.0",
132
+ properties: [{ id: "data", typeid: "Float32", context: "map" }],
133
133
  };
134
134
  var TestPropertyTemplate = {
135
- typeid: 'autodesk.tests:MapTestNamedPropertyID-1.0.0',
136
- inherits: ['NamedProperty'],
135
+ typeid: "autodesk.tests:MapTestNamedPropertyID-1.0.0",
136
+ inherits: ["NamedProperty"],
137
137
  properties: [
138
- { id: 'stringProperty', typeid: 'String' },
139
- { id: 'stringProperty2', typeid: 'String' },
140
- { id: 'map', context: 'map', typeid: 'NamedProperty' },
138
+ { id: "stringProperty", typeid: "String" },
139
+ { id: "stringProperty2", typeid: "String" },
140
+ { id: "map", context: "map", typeid: "NamedProperty" },
141
141
  ],
142
142
  };
143
143
  var AnonymousTestPropertyTemplate = {
144
- typeid: 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0',
145
- properties: [
146
- { id: 'stringProperty', typeid: 'String' },
147
- ],
144
+ typeid: "autodesk.tests:AnonymousMapTestPropertyID-1.0.0",
145
+ properties: [{ id: "stringProperty", typeid: "String" }],
148
146
  };
149
147
  var CuststomArrayTemplate = {
150
- typeid: 'autodesk.tests:CustomArrayChangesetTestID-1.0.0',
148
+ typeid: "autodesk.tests:CustomArrayChangesetTestID-1.0.0",
151
149
  properties: [
152
- { id: 'data', typeid: 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0', context: 'array' },
150
+ {
151
+ id: "data",
152
+ typeid: "autodesk.tests:AnonymousMapTestPropertyID-1.0.0",
153
+ context: "array",
154
+ },
153
155
  ],
154
156
  };
155
157
  var TestEnumTemplate = {
156
- typeid: 'autodesk.core:UnitsEnum-1.0.0',
157
- inherits: 'Enum',
158
- annotation: { description: 'The metric units' },
158
+ typeid: "autodesk.core:UnitsEnum-1.0.0",
159
+ inherits: "Enum",
160
+ annotation: { description: "The metric units" },
159
161
  properties: [
160
- { id: 'm', value: 1, annotation: { description: 'meter' } },
161
- { id: 'cm', value: 2, annotation: { description: 'centimeter' } },
162
- { id: 'mm', value: 3, annotation: { description: 'millimeter' } },
162
+ { id: "m", value: 1, annotation: { description: "meter" } },
163
+ { id: "cm", value: 2, annotation: { description: "centimeter" } },
164
+ { id: "mm", value: 3, annotation: { description: "millimeter" } },
163
165
  ],
164
166
  };
165
167
  PropertyFactory._reregister(TestEnumTemplate);
166
168
  var TestBaseContainingEnumTemplate = {
167
- typeid: 'autodesk.core:CustomWithEnumID-1.0.0',
168
- properties: [{
169
- id: 'data', typeid: 'autodesk.core:UnitsEnum-1.0.0',
170
- }],
169
+ typeid: "autodesk.core:CustomWithEnumID-1.0.0",
170
+ properties: [
171
+ {
172
+ id: "data",
173
+ typeid: "autodesk.core:UnitsEnum-1.0.0",
174
+ },
175
+ ],
171
176
  };
172
177
  var TestInheritsNodePropertyObject = {
173
- inherits: ['NodeProperty'],
174
- typeid: 'autodesk.tests:SimpleInheritsNodeProperty-1.0.0',
178
+ inherits: ["NodeProperty"],
179
+ typeid: "autodesk.tests:SimpleInheritsNodeProperty-1.0.0",
175
180
  };
176
181
  PropertyFactory._reregister(TestInheritsNodePropertyObject);
177
182
  PropertyFactory._reregister(TestEnumTemplate);
@@ -189,148 +194,200 @@ describe('Reversible ChangeSets', function () {
189
194
  PropertyFactory._reregister(TaskSubjectTestTemplate);
190
195
  PropertyFactory._reregister(TestArrayFloat32);
191
196
  });
192
- describe('Make inversible, apply and reverse for primitive properties.', function () {
193
- it('should work for modifying Int8', function () {
194
- var prop = PropertyFactory.create('Int8');
195
- testRevAndInvCS(prop, function () { prop.setValue(10); }, { 'oldValue': 0, 'value': 10 }, 10, { 'oldValue': 10, 'value': 0 });
196
- });
197
- it('should work for modifying Uint8', function () {
198
- var prop = PropertyFactory.create('Uint8');
199
- testRevAndInvCS(prop, function () { prop.setValue(10); }, { 'oldValue': 0, 'value': 10 }, 10, { 'oldValue': 10, 'value': 0 });
200
- });
201
- it('should work for modifying Int16', function () {
202
- var prop = PropertyFactory.create('Int16');
203
- testRevAndInvCS(prop, function () { prop.setValue(10); }, { 'oldValue': 0, 'value': 10 }, 10, { 'oldValue': 10, 'value': 0 });
204
- });
205
- it('should work for modifying Uint16', function () {
206
- var prop = PropertyFactory.create('Uint16');
207
- testRevAndInvCS(prop, function () { prop.setValue(10); }, { 'oldValue': 0, 'value': 10 }, 10, { 'oldValue': 10, 'value': 0 });
208
- });
209
- it('should work for modifying Int32', function () {
210
- var prop = PropertyFactory.create('Int32');
211
- testRevAndInvCS(prop, function () { prop.setValue(10); }, { 'oldValue': 0, 'value': 10 }, 10, { 'oldValue': 10, 'value': 0 });
212
- });
213
- it('should work for modifying Uint32', function () {
214
- var prop = PropertyFactory.create('Uint32');
215
- testRevAndInvCS(prop, function () { prop.setValue(10); }, { 'oldValue': 0, 'value': 10 }, 10, { 'oldValue': 10, 'value': 0 });
216
- });
217
- it('should work for modifying Int64', function () {
218
- var prop = PropertyFactory.create('Int64');
219
- testRevAndInvCS(prop, function () { prop.setValue(new Int64(10, 10)); }, { 'oldValue': [0, 0], 'value': [10, 10] }, [10, 10], { 'oldValue': [10, 10], 'value': [0, 0] });
220
- });
221
- it('should work for modifying Uint64', function () {
222
- var prop = PropertyFactory.create('Uint64');
223
- testRevAndInvCS(prop, function () { prop.setValue(new Uint64(10, 10)); }, { 'oldValue': [0, 0], 'value': [10, 10] }, [10, 10], { 'oldValue': [10, 10], 'value': [0, 0] });
224
- });
225
- it('should work for modifying Float32', function () {
226
- var prop = PropertyFactory.create('Float32');
227
- testRevAndInvCS(prop, function () { prop.setValue(0.5); }, { 'oldValue': 0, 'value': 0.5 }, 0.5, { 'oldValue': 0.5, 'value': 0 });
228
- });
229
- it('should work for modifying Float64', function () {
230
- var prop = PropertyFactory.create('Float64');
231
- testRevAndInvCS(prop, function () { prop.setValue(0.5); }, { 'oldValue': 0, 'value': 0.5 }, 0.5, { 'oldValue': 0.5, 'value': 0 });
232
- });
233
- it('should work for modifying Bool', function () {
234
- var prop = PropertyFactory.create('Bool');
235
- testRevAndInvCS(prop, function () { prop.setValue(true); }, { 'oldValue': false, 'value': true }, true, { 'oldValue': true, 'value': false });
197
+ describe("Make inversible, apply and reverse for primitive properties.", function () {
198
+ it("should work for modifying Int8", function () {
199
+ var prop = PropertyFactory.create("Int8");
200
+ testRevAndInvCS(prop, function () {
201
+ prop.setValue(10);
202
+ }, { oldValue: 0, value: 10 }, 10, { oldValue: 10, value: 0 });
203
+ });
204
+ it("should work for modifying Uint8", function () {
205
+ var prop = PropertyFactory.create("Uint8");
206
+ testRevAndInvCS(prop, function () {
207
+ prop.setValue(10);
208
+ }, { oldValue: 0, value: 10 }, 10, { oldValue: 10, value: 0 });
209
+ });
210
+ it("should work for modifying Int16", function () {
211
+ var prop = PropertyFactory.create("Int16");
212
+ testRevAndInvCS(prop, function () {
213
+ prop.setValue(10);
214
+ }, { oldValue: 0, value: 10 }, 10, { oldValue: 10, value: 0 });
215
+ });
216
+ it("should work for modifying Uint16", function () {
217
+ var prop = PropertyFactory.create("Uint16");
218
+ testRevAndInvCS(prop, function () {
219
+ prop.setValue(10);
220
+ }, { oldValue: 0, value: 10 }, 10, { oldValue: 10, value: 0 });
221
+ });
222
+ it("should work for modifying Int32", function () {
223
+ var prop = PropertyFactory.create("Int32");
224
+ testRevAndInvCS(prop, function () {
225
+ prop.setValue(10);
226
+ }, { oldValue: 0, value: 10 }, 10, { oldValue: 10, value: 0 });
227
+ });
228
+ it("should work for modifying Uint32", function () {
229
+ var prop = PropertyFactory.create("Uint32");
230
+ testRevAndInvCS(prop, function () {
231
+ prop.setValue(10);
232
+ }, { oldValue: 0, value: 10 }, 10, { oldValue: 10, value: 0 });
233
+ });
234
+ it("should work for modifying Int64", function () {
235
+ var prop = PropertyFactory.create("Int64");
236
+ testRevAndInvCS(prop, function () {
237
+ prop.setValue(new Int64(10, 10));
238
+ }, { oldValue: [0, 0], value: [10, 10] }, [10, 10], { oldValue: [10, 10], value: [0, 0] });
239
+ });
240
+ it("should work for modifying Uint64", function () {
241
+ var prop = PropertyFactory.create("Uint64");
242
+ testRevAndInvCS(prop, function () {
243
+ prop.setValue(new Uint64(10, 10));
244
+ }, { oldValue: [0, 0], value: [10, 10] }, [10, 10], { oldValue: [10, 10], value: [0, 0] });
245
+ });
246
+ it("should work for modifying Float32", function () {
247
+ var prop = PropertyFactory.create("Float32");
248
+ testRevAndInvCS(prop, function () {
249
+ prop.setValue(0.5);
250
+ }, { oldValue: 0, value: 0.5 }, 0.5, { oldValue: 0.5, value: 0 });
251
+ });
252
+ it("should work for modifying Float64", function () {
253
+ var prop = PropertyFactory.create("Float64");
254
+ testRevAndInvCS(prop, function () {
255
+ prop.setValue(0.5);
256
+ }, { oldValue: 0, value: 0.5 }, 0.5, { oldValue: 0.5, value: 0 });
257
+ });
258
+ it("should work for modifying Bool", function () {
259
+ var prop = PropertyFactory.create("Bool");
260
+ testRevAndInvCS(prop, function () {
261
+ prop.setValue(true);
262
+ }, { oldValue: false, value: true }, true, { oldValue: true, value: false });
236
263
  });
237
264
  // These tests have been disabled, since the interface of
238
265
  // the ChangeSet class is ambiguous when inserting a string
239
- it.skip('@bugfix should work for modifying String', function () {
240
- var prop = PropertyFactory.create('String');
241
- testRevAndInvCS(prop, function () { prop.setValue('test'); }, { 'oldValue': '', 'value': 'test' }, 'test', { 'oldValue': 'test', 'value': '' });
266
+ it.skip("@bugfix should work for modifying String", function () {
267
+ var prop = PropertyFactory.create("String");
268
+ testRevAndInvCS(prop, function () {
269
+ prop.setValue("test");
270
+ }, { oldValue: "", value: "test" }, "test", { oldValue: "test", value: "" });
242
271
  });
243
272
  // These tests have been disabled, since the interface of
244
273
  // the ChangeSet class is ambiguous when inserting a string
245
- it.skip('@bugfix should work for modifying Reference', function () {
246
- var prop = PropertyFactory.create('Reference');
247
- testRevAndInvCS(prop, function () { prop.setValue('/'); }, { 'oldValue': '', 'value': '/' }, '/', { 'oldValue': '/', 'value': '' });
274
+ it.skip("@bugfix should work for modifying Reference", function () {
275
+ var prop = PropertyFactory.create("Reference");
276
+ testRevAndInvCS(prop, function () {
277
+ prop.setValue("/");
278
+ }, { oldValue: "", value: "/" }, "/", { oldValue: "/", value: "" });
248
279
  });
249
280
  });
250
- describe('Make inversible, apply and reverse for primitive properties in a NodeProperty.', function () {
251
- it('should work for modifying Int8', function () {
252
- var node = PropertyFactory.create('NodeProperty');
253
- var prop = PropertyFactory.create('Int8');
254
- node.insert('prop', prop);
255
- testRevAndInvCS(node, function () { prop.setValue(10); }, { 'modify': { 'Int8': { 'prop': { 'oldValue': 0, 'value': 10 } } } }, { 'insert': { 'Int8': { 'prop': 10 } } }, { 'modify': { 'Int8': { 'prop': { 'oldValue': 10, 'value': 0 } } } });
256
- });
257
- it('should work for modifying Uint8', function () {
258
- var node = PropertyFactory.create('NodeProperty');
259
- var prop = PropertyFactory.create('Uint8');
260
- node.insert('prop', prop);
261
- testRevAndInvCS(node, function () { prop.setValue(10); }, { 'modify': { 'Uint8': { 'prop': { 'oldValue': 0, 'value': 10 } } } }, { 'insert': { 'Uint8': { 'prop': 10 } } }, { 'modify': { 'Uint8': { 'prop': { 'oldValue': 10, 'value': 0 } } } });
262
- });
263
- it('should work for modifying Int16', function () {
264
- var node = PropertyFactory.create('NodeProperty');
265
- var prop = PropertyFactory.create('Int16');
266
- node.insert('prop', prop);
267
- testRevAndInvCS(node, function () { prop.setValue(10); }, { 'modify': { 'Int16': { 'prop': { 'oldValue': 0, 'value': 10 } } } }, { 'insert': { 'Int16': { 'prop': 10 } } }, { 'modify': { 'Int16': { 'prop': { 'oldValue': 10, 'value': 0 } } } });
268
- });
269
- it('should work for modifying Uint16', function () {
270
- var node = PropertyFactory.create('NodeProperty');
271
- var prop = PropertyFactory.create('Uint16');
272
- node.insert('prop', prop);
273
- testRevAndInvCS(node, function () { prop.setValue(10); }, { 'modify': { 'Uint16': { 'prop': { 'oldValue': 0, 'value': 10 } } } }, { 'insert': { 'Uint16': { 'prop': 10 } } }, { 'modify': { 'Uint16': { 'prop': { 'oldValue': 10, 'value': 0 } } } });
274
- });
275
- it('should work for modifying Int32', function () {
276
- var node = PropertyFactory.create('NodeProperty');
277
- var prop = PropertyFactory.create('Int32');
278
- node.insert('prop', prop);
279
- testRevAndInvCS(node, function () { prop.setValue(10); }, { 'modify': { 'Int32': { 'prop': { 'oldValue': 0, 'value': 10 } } } }, { 'insert': { 'Int32': { 'prop': 10 } } }, { 'modify': { 'Int32': { 'prop': { 'oldValue': 10, 'value': 0 } } } });
280
- });
281
- it('should work for modifying Uint32', function () {
282
- var node = PropertyFactory.create('NodeProperty');
283
- var prop = PropertyFactory.create('Uint32');
284
- node.insert('prop', prop);
285
- testRevAndInvCS(node, function () { prop.setValue(10); }, { 'modify': { 'Uint32': { 'prop': { 'oldValue': 0, 'value': 10 } } } }, { 'insert': { 'Uint32': { 'prop': 10 } } }, { 'modify': { 'Uint32': { 'prop': { 'oldValue': 10, 'value': 0 } } } });
286
- });
287
- it('should work for modifying Int64', function () {
288
- var node = PropertyFactory.create('NodeProperty');
289
- var prop = PropertyFactory.create('Int64');
290
- node.insert('prop', prop);
291
- testRevAndInvCS(node, function () { prop.setValue(new Int64(10, 10)); }, { 'modify': { 'Int64': { 'prop': { 'oldValue': [0, 0], 'value': [10, 10] } } } }, { 'insert': { 'Int64': { 'prop': [10, 10] } } }, { 'modify': { 'Int64': { 'prop': { 'oldValue': [10, 10], 'value': [0, 0] } } } });
292
- });
293
- it('should work for modifying Uint64', function () {
294
- var node = PropertyFactory.create('NodeProperty');
295
- var prop = PropertyFactory.create('Uint64');
296
- node.insert('prop', prop);
297
- testRevAndInvCS(node, function () { prop.setValue(new Uint64(10, 10)); }, { 'modify': { 'Uint64': { 'prop': { 'oldValue': [0, 0], 'value': [10, 10] } } } }, { 'insert': { 'Uint64': { 'prop': [10, 10] } } }, { 'modify': { 'Uint64': { 'prop': { 'oldValue': [10, 10], 'value': [0, 0] } } } });
298
- });
299
- it('should work for modifying Float32', function () {
300
- var node = PropertyFactory.create('NodeProperty');
301
- var prop = PropertyFactory.create('Float32');
302
- node.insert('prop', prop);
303
- testRevAndInvCS(node, function () { prop.setValue(0.5); }, { 'modify': { 'Float32': { 'prop': { 'oldValue': 0, 'value': 0.5 } } } }, { 'insert': { 'Float32': { 'prop': 0.5 } } }, { 'modify': { 'Float32': { 'prop': { 'oldValue': 0.5, 'value': 0 } } } });
304
- });
305
- it('should work for modifying Float64', function () {
306
- var node = PropertyFactory.create('NodeProperty');
307
- var prop = PropertyFactory.create('Float64');
308
- node.insert('prop', prop);
309
- testRevAndInvCS(node, function () { prop.setValue(0.5); }, { 'modify': { 'Float64': { 'prop': { 'oldValue': 0, 'value': 0.5 } } } }, { 'insert': { 'Float64': { 'prop': 0.5 } } }, { 'modify': { 'Float64': { 'prop': { 'oldValue': 0.5, 'value': 0 } } } });
310
- });
311
- it('should work for modifying Bool', function () {
312
- var node = PropertyFactory.create('NodeProperty');
313
- var prop = PropertyFactory.create('Bool');
314
- node.insert('prop', prop);
315
- testRevAndInvCS(node, function () { prop.setValue(true); }, { 'modify': { 'Bool': { 'prop': { 'oldValue': false, 'value': true } } } }, { 'insert': { 'Bool': { 'prop': true } } }, { 'modify': { 'Bool': { 'prop': { 'oldValue': true, 'value': false } } } });
316
- });
317
- it('should work for modifying String', function () {
318
- var node = PropertyFactory.create('NodeProperty');
319
- var prop = PropertyFactory.create('String');
320
- node.insert('prop', prop);
321
- testRevAndInvCS(node, function () { prop.setValue('test'); }, { 'modify': { 'String': { 'prop': { 'oldValue': '', 'value': 'test' } } } }, { 'insert': { 'String': { 'prop': 'test' } } }, { 'modify': { 'String': { 'prop': { 'oldValue': 'test', 'value': '' } } } });
322
- });
323
- it('should work for modifying Reference', function () {
324
- var node = PropertyFactory.create('NodeProperty');
325
- var prop = PropertyFactory.create('Reference');
326
- node.insert('prop', prop);
327
- testRevAndInvCS(node, function () { prop.setValue('/'); }, { 'modify': { 'Reference': { 'prop': { 'oldValue': '', 'value': '/' } } } }, { 'insert': { 'Reference': { 'prop': '/' } } }, { 'modify': { 'Reference': { 'prop': { 'oldValue': '/', 'value': '' } } } });
281
+ describe("Make inversible, apply and reverse for primitive properties in a NodeProperty.", function () {
282
+ it("should work for modifying Int8", function () {
283
+ var node = PropertyFactory.create("NodeProperty");
284
+ var prop = PropertyFactory.create("Int8");
285
+ node.insert("prop", prop);
286
+ testRevAndInvCS(node, function () {
287
+ prop.setValue(10);
288
+ }, { modify: { Int8: { prop: { oldValue: 0, value: 10 } } } }, { insert: { Int8: { prop: 10 } } }, { modify: { Int8: { prop: { oldValue: 10, value: 0 } } } });
289
+ });
290
+ it("should work for modifying Uint8", function () {
291
+ var node = PropertyFactory.create("NodeProperty");
292
+ var prop = PropertyFactory.create("Uint8");
293
+ node.insert("prop", prop);
294
+ testRevAndInvCS(node, function () {
295
+ prop.setValue(10);
296
+ }, { modify: { Uint8: { prop: { oldValue: 0, value: 10 } } } }, { insert: { Uint8: { prop: 10 } } }, { modify: { Uint8: { prop: { oldValue: 10, value: 0 } } } });
297
+ });
298
+ it("should work for modifying Int16", function () {
299
+ var node = PropertyFactory.create("NodeProperty");
300
+ var prop = PropertyFactory.create("Int16");
301
+ node.insert("prop", prop);
302
+ testRevAndInvCS(node, function () {
303
+ prop.setValue(10);
304
+ }, { modify: { Int16: { prop: { oldValue: 0, value: 10 } } } }, { insert: { Int16: { prop: 10 } } }, { modify: { Int16: { prop: { oldValue: 10, value: 0 } } } });
305
+ });
306
+ it("should work for modifying Uint16", function () {
307
+ var node = PropertyFactory.create("NodeProperty");
308
+ var prop = PropertyFactory.create("Uint16");
309
+ node.insert("prop", prop);
310
+ testRevAndInvCS(node, function () {
311
+ prop.setValue(10);
312
+ }, { modify: { Uint16: { prop: { oldValue: 0, value: 10 } } } }, { insert: { Uint16: { prop: 10 } } }, { modify: { Uint16: { prop: { oldValue: 10, value: 0 } } } });
313
+ });
314
+ it("should work for modifying Int32", function () {
315
+ var node = PropertyFactory.create("NodeProperty");
316
+ var prop = PropertyFactory.create("Int32");
317
+ node.insert("prop", prop);
318
+ testRevAndInvCS(node, function () {
319
+ prop.setValue(10);
320
+ }, { modify: { Int32: { prop: { oldValue: 0, value: 10 } } } }, { insert: { Int32: { prop: 10 } } }, { modify: { Int32: { prop: { oldValue: 10, value: 0 } } } });
321
+ });
322
+ it("should work for modifying Uint32", function () {
323
+ var node = PropertyFactory.create("NodeProperty");
324
+ var prop = PropertyFactory.create("Uint32");
325
+ node.insert("prop", prop);
326
+ testRevAndInvCS(node, function () {
327
+ prop.setValue(10);
328
+ }, { modify: { Uint32: { prop: { oldValue: 0, value: 10 } } } }, { insert: { Uint32: { prop: 10 } } }, { modify: { Uint32: { prop: { oldValue: 10, value: 0 } } } });
329
+ });
330
+ it("should work for modifying Int64", function () {
331
+ var node = PropertyFactory.create("NodeProperty");
332
+ var prop = PropertyFactory.create("Int64");
333
+ node.insert("prop", prop);
334
+ testRevAndInvCS(node, function () {
335
+ prop.setValue(new Int64(10, 10));
336
+ }, { modify: { Int64: { prop: { oldValue: [0, 0], value: [10, 10] } } } }, { insert: { Int64: { prop: [10, 10] } } }, { modify: { Int64: { prop: { oldValue: [10, 10], value: [0, 0] } } } });
337
+ });
338
+ it("should work for modifying Uint64", function () {
339
+ var node = PropertyFactory.create("NodeProperty");
340
+ var prop = PropertyFactory.create("Uint64");
341
+ node.insert("prop", prop);
342
+ testRevAndInvCS(node, function () {
343
+ prop.setValue(new Uint64(10, 10));
344
+ }, { modify: { Uint64: { prop: { oldValue: [0, 0], value: [10, 10] } } } }, { insert: { Uint64: { prop: [10, 10] } } }, { modify: { Uint64: { prop: { oldValue: [10, 10], value: [0, 0] } } } });
345
+ });
346
+ it("should work for modifying Float32", function () {
347
+ var node = PropertyFactory.create("NodeProperty");
348
+ var prop = PropertyFactory.create("Float32");
349
+ node.insert("prop", prop);
350
+ testRevAndInvCS(node, function () {
351
+ prop.setValue(0.5);
352
+ }, { modify: { Float32: { prop: { oldValue: 0, value: 0.5 } } } }, { insert: { Float32: { prop: 0.5 } } }, { modify: { Float32: { prop: { oldValue: 0.5, value: 0 } } } });
353
+ });
354
+ it("should work for modifying Float64", function () {
355
+ var node = PropertyFactory.create("NodeProperty");
356
+ var prop = PropertyFactory.create("Float64");
357
+ node.insert("prop", prop);
358
+ testRevAndInvCS(node, function () {
359
+ prop.setValue(0.5);
360
+ }, { modify: { Float64: { prop: { oldValue: 0, value: 0.5 } } } }, { insert: { Float64: { prop: 0.5 } } }, { modify: { Float64: { prop: { oldValue: 0.5, value: 0 } } } });
361
+ });
362
+ it("should work for modifying Bool", function () {
363
+ var node = PropertyFactory.create("NodeProperty");
364
+ var prop = PropertyFactory.create("Bool");
365
+ node.insert("prop", prop);
366
+ testRevAndInvCS(node, function () {
367
+ prop.setValue(true);
368
+ }, { modify: { Bool: { prop: { oldValue: false, value: true } } } }, { insert: { Bool: { prop: true } } }, { modify: { Bool: { prop: { oldValue: true, value: false } } } });
369
+ });
370
+ it("should work for modifying String", function () {
371
+ var node = PropertyFactory.create("NodeProperty");
372
+ var prop = PropertyFactory.create("String");
373
+ node.insert("prop", prop);
374
+ testRevAndInvCS(node, function () {
375
+ prop.setValue("test");
376
+ }, { modify: { String: { prop: { oldValue: "", value: "test" } } } }, { insert: { String: { prop: "test" } } }, { modify: { String: { prop: { oldValue: "test", value: "" } } } });
377
+ });
378
+ it("should work for modifying Reference", function () {
379
+ var node = PropertyFactory.create("NodeProperty");
380
+ var prop = PropertyFactory.create("Reference");
381
+ node.insert("prop", prop);
382
+ testRevAndInvCS(node, function () {
383
+ prop.setValue("/");
384
+ }, { modify: { Reference: { prop: { oldValue: "", value: "/" } } } }, { insert: { Reference: { prop: "/" } } }, { modify: { Reference: { prop: { oldValue: "/", value: "" } } } });
328
385
  });
329
386
  });
330
- describe('apply reversible ChangeSets on all properties', function () {
331
- it('should work for primitive properties', function () {
332
- var prop = PropertyFactory.create('autodesk.test:vector3-1.0.0');
333
- var propCopy = PropertyFactory.create('autodesk.test:vector3-1.0.0');
387
+ describe("apply reversible ChangeSets on all properties", function () {
388
+ it("should work for primitive properties", function () {
389
+ var prop = PropertyFactory.create("autodesk.test:vector3-1.0.0");
390
+ var propCopy = PropertyFactory.create("autodesk.test:vector3-1.0.0");
334
391
  prop._properties.x.value = 2;
335
392
  var changeSet = new ChangeSet(prop._serialize(true));
336
393
  changeSet._toReversibleChangeSet(propCopy._serialize(false));
@@ -338,24 +395,24 @@ describe('Reversible ChangeSets', function () {
338
395
  expect(prop._serialize()).to.deep.equal(propCopy._serialize());
339
396
  expect(prop._serialize(true)).to.deep.equal(propCopy._serialize(true));
340
397
  });
341
- it('should work for string properties', function () {
342
- var prop = PropertyFactory.create('autodesk.tests:DataStringTestProperty-1.0.0');
343
- var propCopy = PropertyFactory.create('autodesk.tests:DataStringTestProperty-1.0.0');
344
- prop._properties.data.value = 'A';
398
+ it("should work for string properties", function () {
399
+ var prop = PropertyFactory.create("autodesk.tests:DataStringTestProperty-1.0.0");
400
+ var propCopy = PropertyFactory.create("autodesk.tests:DataStringTestProperty-1.0.0");
401
+ prop._properties.data.value = "A";
345
402
  var changeSet = new ChangeSet(prop._serialize(true));
346
403
  changeSet._toReversibleChangeSet(propCopy._serialize(false));
347
404
  propCopy.applyChangeSet(changeSet.getSerializedChangeSet());
348
405
  expect(prop._serialize()).to.deep.equal(propCopy._serialize());
349
406
  expect(prop._serialize(true)).to.deep.equal(propCopy._serialize(true));
350
407
  });
351
- it('should work for reference properties', function () {
352
- var root = PropertyFactory.create('NodeProperty');
353
- var prop = PropertyFactory.create('autodesk.tests:DataRefTestProperty-1.0.0');
354
- var propCopy = PropertyFactory.create('autodesk.tests:DataRefTestProperty-1.0.0');
355
- var target = PropertyFactory.create('String');
356
- root.insert('target', target);
357
- root.insert('reference', prop);
358
- root.insert('referenceCopy', propCopy);
408
+ it("should work for reference properties", function () {
409
+ var root = PropertyFactory.create("NodeProperty");
410
+ var prop = PropertyFactory.create("autodesk.tests:DataRefTestProperty-1.0.0");
411
+ var propCopy = PropertyFactory.create("autodesk.tests:DataRefTestProperty-1.0.0");
412
+ var target = PropertyFactory.create("String");
413
+ root.insert("target", target);
414
+ root.insert("reference", prop);
415
+ root.insert("referenceCopy", propCopy);
359
416
  prop._properties.data.set(target);
360
417
  var changeSet = new ChangeSet(prop._serialize(true));
361
418
  changeSet._toReversibleChangeSet(propCopy._serialize(false));
@@ -363,291 +420,316 @@ describe('Reversible ChangeSets', function () {
363
420
  expect(prop._serialize()).to.deep.equal(propCopy._serialize());
364
421
  expect(prop._serialize(true)).to.deep.equal(propCopy._serialize(true));
365
422
  });
366
- it('should work for enum properties', function () {
367
- var prop = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');
368
- var propCopy = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');
369
- prop._properties.data.value = 'cm';
423
+ it("should work for enum properties", function () {
424
+ var prop = PropertyFactory.create("autodesk.core:CustomWithEnumID-1.0.0");
425
+ var propCopy = PropertyFactory.create("autodesk.core:CustomWithEnumID-1.0.0");
426
+ prop._properties.data.value = "cm";
370
427
  var changeSet = new ChangeSet(prop._serialize(true));
371
428
  changeSet._toReversibleChangeSet(propCopy._serialize(false));
372
429
  propCopy.applyChangeSet(changeSet.getSerializedChangeSet());
373
430
  expect(prop._serialize()).to.deep.equal(propCopy._serialize());
374
431
  expect(prop._serialize(true)).to.deep.equal(propCopy._serialize(true));
375
432
  });
376
- it('should work for indexed collections of complex types', function () {
377
- var prop = PropertyFactory.create('autodesk.tests:MapTestNamedPropertyID-1.0.0');
378
- var propCopy = PropertyFactory.create('autodesk.tests:MapTestNamedPropertyID-1.0.0');
379
- var A = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
380
- var B = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
381
- var C = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
382
- prop._properties.map.insert('A', A);
383
- prop._properties.map.insert('B', B);
384
- prop._properties.map.insert('C', C);
433
+ it("should work for indexed collections of complex types", function () {
434
+ var prop = PropertyFactory.create("autodesk.tests:MapTestNamedPropertyID-1.0.0");
435
+ var propCopy = PropertyFactory.create("autodesk.tests:MapTestNamedPropertyID-1.0.0");
436
+ var A = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
437
+ var B = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
438
+ var C = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
439
+ prop._properties.map.insert("A", A);
440
+ prop._properties.map.insert("B", B);
441
+ prop._properties.map.insert("C", C);
385
442
  propCopy.deserialize(prop._serialize());
386
443
  prop.cleanDirty();
387
444
  propCopy.cleanDirty();
388
- prop._properties.map.remove('B');
389
- prop._properties.map.get('A')._properties.stringProperty.value = 'hello';
445
+ prop._properties.map.remove("B");
446
+ prop._properties.map.get("A")._properties.stringProperty.value = "hello";
390
447
  var changeSet = new ChangeSet(prop._serialize(true));
391
448
  changeSet._toReversibleChangeSet(propCopy._serialize(false));
392
449
  propCopy.applyChangeSet(changeSet.getSerializedChangeSet());
393
450
  expect(prop._serialize()).to.deep.equal(propCopy._serialize());
394
451
  expect(prop._serialize(true)).to.deep.equal(propCopy._serialize(true));
395
452
  });
396
- it('should work for indexed collections of primitive types', function () {
397
- var prop = PropertyFactory.create('autodesk.tests:MapTestPropertyID-1.0.0');
398
- var propCopy = PropertyFactory.create('autodesk.tests:MapTestPropertyID-1.0.0');
399
- prop._properties.data.insert('A', 1);
400
- prop._properties.data.insert('B', 2);
401
- prop._properties.data.insert('C', 3);
453
+ it("should work for indexed collections of primitive types", function () {
454
+ var prop = PropertyFactory.create("autodesk.tests:MapTestPropertyID-1.0.0");
455
+ var propCopy = PropertyFactory.create("autodesk.tests:MapTestPropertyID-1.0.0");
456
+ prop._properties.data.insert("A", 1);
457
+ prop._properties.data.insert("B", 2);
458
+ prop._properties.data.insert("C", 3);
402
459
  propCopy.deserialize(prop._serialize());
403
460
  prop.cleanDirty();
404
461
  propCopy.cleanDirty();
405
- prop._properties.data.remove('B');
406
- prop._properties.data.set('C', 99);
462
+ prop._properties.data.remove("B");
463
+ prop._properties.data.set("C", 99);
407
464
  var changeSet = new ChangeSet(prop._serialize(true));
408
465
  changeSet._toReversibleChangeSet(propCopy._serialize(false));
409
466
  propCopy.applyChangeSet(changeSet.getSerializedChangeSet());
410
467
  expect(prop._serialize()).to.deep.equal(propCopy._serialize());
411
468
  expect(prop._serialize(true)).to.deep.equal(propCopy._serialize(true));
412
469
  });
413
- it('should work for custom array properties', function () {
414
- var prop = PropertyFactory.create('autodesk.tests:CustomArrayChangesetTestID-1.0.0');
415
- var propCopy = PropertyFactory.create('autodesk.tests:CustomArrayChangesetTestID-1.0.0');
416
- var A = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
417
- var B = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
418
- var C = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
470
+ it("should work for custom array properties", function () {
471
+ var prop = PropertyFactory.create("autodesk.tests:CustomArrayChangesetTestID-1.0.0");
472
+ var propCopy = PropertyFactory.create("autodesk.tests:CustomArrayChangesetTestID-1.0.0");
473
+ var A = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
474
+ var B = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
475
+ var C = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
419
476
  prop._properties.data.insertRange(0, [A, B, C]);
420
477
  propCopy.deserialize(prop.serialize());
421
478
  prop.cleanDirty();
422
479
  propCopy.cleanDirty();
423
- prop._properties.data.get(2)._properties.stringProperty.value = 'hello';
480
+ prop._properties.data.get(2)._properties.stringProperty.value = "hello";
424
481
  prop._properties.data.removeRange(1, 1);
425
- var changeSet = new ChangeSet(prop.serialize({ 'dirtyOnly': true }));
426
- var baseState = propCopy.serialize({ 'dirtyOnly': false });
482
+ var changeSet = new ChangeSet(prop.serialize({ dirtyOnly: true }));
483
+ var baseState = propCopy.serialize({ dirtyOnly: false });
427
484
  changeSet._toReversibleChangeSet(baseState);
428
485
  propCopy.applyChangeSet(changeSet.getSerializedChangeSet());
429
486
  expect(prop.serialize()).to.deep.equal(propCopy.serialize());
430
- expect(prop.serialize({ 'dirtyOnly': true })).to.deep.equal(propCopy.serialize({ 'dirtyOnly': true }));
487
+ expect(prop.serialize({ dirtyOnly: true })).to.deep.equal(propCopy.serialize({ dirtyOnly: true }));
431
488
  });
432
- it('should work for primitive array properties', function () {
433
- var prop = PropertyFactory.create('autodesk.test:test.arrayfloat32-1.0.0');
434
- var propCopy = PropertyFactory.create('autodesk.test:test.arrayfloat32-1.0.0');
489
+ it("should work for primitive array properties", function () {
490
+ var prop = PropertyFactory.create("autodesk.test:test.arrayfloat32-1.0.0");
491
+ var propCopy = PropertyFactory.create("autodesk.test:test.arrayfloat32-1.0.0");
435
492
  prop._properties.data.insertRange(0, [10, 11, 12, 13, 14, 15, 16]);
436
493
  propCopy._properties.data.insertRange(0, [10, 11, 12, 13, 14, 15, 16]);
437
494
  prop.cleanDirty();
438
495
  propCopy.cleanDirty();
439
496
  prop._properties.data.setRange(4, [24, 25]);
440
497
  prop._properties.data.removeRange(1, 2);
441
- var changeSet = new ChangeSet(prop.serialize({ 'dirtyOnly': true }));
442
- changeSet._toReversibleChangeSet(propCopy.serialize({ 'dirtyOnly': false }));
498
+ var changeSet = new ChangeSet(prop.serialize({ dirtyOnly: true }));
499
+ changeSet._toReversibleChangeSet(propCopy.serialize({ dirtyOnly: false }));
443
500
  propCopy.applyChangeSet(changeSet.getSerializedChangeSet());
444
501
  expect(prop.serialize()).to.deep.equal(propCopy.serialize());
445
- expect(prop.serialize({ 'dirtyOnly': true })).to.deep.equal(propCopy.serialize({ 'dirtyOnly': true }));
446
- });
447
- it('should work for node properties', function () {
448
- var prop = PropertyFactory.create('NodeProperty');
449
- var propCopy = PropertyFactory.create('NodeProperty');
450
- var A = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
451
- var B = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
452
- var C = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
453
- var D = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
454
- prop.insert('A', A);
455
- prop.insert('B', B);
456
- prop.insert('C', C);
457
- prop.insert('D', D);
458
- var initialChangeset = prop.serialize({ 'dirtyOnly': false });
502
+ expect(prop.serialize({ dirtyOnly: true })).to.deep.equal(propCopy.serialize({ dirtyOnly: true }));
503
+ });
504
+ it("should work for node properties", function () {
505
+ var prop = PropertyFactory.create("NodeProperty");
506
+ var propCopy = PropertyFactory.create("NodeProperty");
507
+ var A = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
508
+ var B = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
509
+ var C = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
510
+ var D = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
511
+ prop.insert("A", A);
512
+ prop.insert("B", B);
513
+ prop.insert("C", C);
514
+ prop.insert("D", D);
515
+ var initialChangeset = prop.serialize({ dirtyOnly: false });
459
516
  propCopy.deserialize(initialChangeset);
460
517
  prop.cleanDirty();
461
518
  propCopy.cleanDirty();
462
- prop._properties.A.stringProperty.value = 'test';
463
- prop.remove('B');
464
- prop.remove('C');
465
- var changeSet = new ChangeSet(prop.serialize({ 'dirtyOnly': true }));
519
+ prop._properties.A.stringProperty.value = "test";
520
+ prop.remove("B");
521
+ prop.remove("C");
522
+ var changeSet = new ChangeSet(prop.serialize({ dirtyOnly: true }));
466
523
  changeSet._toReversibleChangeSet(initialChangeset);
467
524
  propCopy.applyChangeSet(changeSet.getSerializedChangeSet());
468
525
  expect(prop.serialize()).to.deep.equal(propCopy.serialize());
469
- expect(prop.serialize({ 'dirtyOnly': true })).to.deep.equal(propCopy.serialize({ 'dirtyOnly': true }));
470
- });
471
- it('should work for inherits node properties', function () {
472
- var root = PropertyFactory.create('NodeProperty');
473
- var prop = PropertyFactory.create('autodesk.tests:SimpleInheritsNodeProperty-1.0.0');
474
- root.insert('prop', prop);
475
- var rootCopy = PropertyFactory.create('NodeProperty');
476
- var propCopy = PropertyFactory.create('autodesk.tests:SimpleInheritsNodeProperty-1.0.0');
477
- rootCopy.insert('prop', propCopy);
478
- var A = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
479
- var B = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
480
- var C = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
481
- var D = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
482
- prop.insert('A', A);
483
- prop.insert('B', B);
484
- prop.insert('C', C);
485
- prop.insert('D', D);
486
- var initialChangeset = root.serialize({ 'dirtyOnly': false });
526
+ expect(prop.serialize({ dirtyOnly: true })).to.deep.equal(propCopy.serialize({ dirtyOnly: true }));
527
+ });
528
+ it("should work for inherits node properties", function () {
529
+ var root = PropertyFactory.create("NodeProperty");
530
+ var prop = PropertyFactory.create("autodesk.tests:SimpleInheritsNodeProperty-1.0.0");
531
+ root.insert("prop", prop);
532
+ var rootCopy = PropertyFactory.create("NodeProperty");
533
+ var propCopy = PropertyFactory.create("autodesk.tests:SimpleInheritsNodeProperty-1.0.0");
534
+ rootCopy.insert("prop", propCopy);
535
+ var A = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
536
+ var B = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
537
+ var C = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
538
+ var D = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
539
+ prop.insert("A", A);
540
+ prop.insert("B", B);
541
+ prop.insert("C", C);
542
+ prop.insert("D", D);
543
+ var initialChangeset = root.serialize({ dirtyOnly: false });
487
544
  rootCopy.deserialize(initialChangeset);
488
545
  root.cleanDirty();
489
546
  rootCopy.cleanDirty();
490
- prop._properties.A.stringProperty.value = 'test';
491
- prop.remove('B');
492
- prop.remove('C');
493
- var changeSet = new ChangeSet(root.serialize({ 'dirtyOnly': true }));
547
+ prop._properties.A.stringProperty.value = "test";
548
+ prop.remove("B");
549
+ prop.remove("C");
550
+ var changeSet = new ChangeSet(root.serialize({ dirtyOnly: true }));
494
551
  changeSet._toReversibleChangeSet(initialChangeset);
495
552
  rootCopy.applyChangeSet(changeSet.getSerializedChangeSet());
496
553
  expect(root.serialize()).to.deep.equal(rootCopy.serialize());
497
- expect(root.serialize({ 'dirtyOnly': true })).to.deep.equal(rootCopy.serialize({ 'dirtyOnly': true }));
554
+ expect(root.serialize({ dirtyOnly: true })).to.deep.equal(rootCopy.serialize({ dirtyOnly: true }));
498
555
  });
499
556
  });
500
- describe('Apply with reversible ChangeSets', function () {
557
+ describe("Apply with reversible ChangeSets", function () {
501
558
  var overlapApplyTest = function (in_type, in_inputArrayOperations1, in_inputArrayOperations2, in_outputArrayOperations) {
502
559
  var convertModificationSetToArray = function (in_modificationSet) {
503
560
  return in_modificationSet.map((x) => {
504
- return x[2] === undefined ?
505
- [x[0], x[1].split('')] :
506
- [x[0], x[1].split(''), x[2].split('')];
561
+ return x[2] === undefined
562
+ ? [x[0], x[1].split("")]
563
+ : [x[0], x[1].split(""), x[2].split("")];
507
564
  });
508
565
  };
509
566
  var performApplyTest = function (in_typeid, inputArrayOperations1, inputArrayOperations2, outputArrayOperations) {
510
- var CS1 = new ChangeSet({ 'modify': { [in_typeid]: { 'arr': { [in_type]: inputArrayOperations1 } } } });
511
- var CS2 = { 'modify': { [in_typeid]: { 'arr': { [in_type]: inputArrayOperations2 } } } };
567
+ var CS1 = new ChangeSet({
568
+ modify: { [in_typeid]: { arr: { [in_type]: inputArrayOperations1 } } },
569
+ });
570
+ var CS2 = {
571
+ modify: { [in_typeid]: { arr: { [in_type]: inputArrayOperations2 } } },
572
+ };
512
573
  var CS2_copy = deepCopy(CS2);
513
574
  CS1.applyChangeSet(CS2);
514
575
  // CS2 should be unchanged
515
576
  expect(CS2).to.deep.equal(CS2_copy);
516
577
  // CS2 should no longer contain the removal of A
517
578
  expect(CS1.getSerializedChangeSet()).to.deep.equal({
518
- 'modify': { [in_typeid]: { 'arr': { [in_type]: outputArrayOperations } } },
579
+ modify: { [in_typeid]: { arr: { [in_type]: outputArrayOperations } } },
519
580
  });
520
581
  };
521
- it('on strings', function () {
522
- performApplyTest('String', deepCopy(in_inputArrayOperations1), in_inputArrayOperations2, in_outputArrayOperations);
582
+ it("on strings", function () {
583
+ performApplyTest("String", deepCopy(in_inputArrayOperations1), in_inputArrayOperations2, in_outputArrayOperations);
523
584
  });
524
- it('on arrays', function () {
525
- performApplyTest('array<String>', convertModificationSetToArray(in_inputArrayOperations1), convertModificationSetToArray(in_inputArrayOperations2), convertModificationSetToArray(in_outputArrayOperations));
585
+ it("on arrays", function () {
586
+ performApplyTest("array<String>", convertModificationSetToArray(in_inputArrayOperations1), convertModificationSetToArray(in_inputArrayOperations2), convertModificationSetToArray(in_outputArrayOperations));
526
587
  });
527
588
  };
528
- describe('for overlapping modifies 1', function () {
529
- overlapApplyTest('modify', [[3, 'abc', '123']], [[3, 'def', 'abc']], [[3, 'def', '123']]);
589
+ describe("for overlapping modifies 1", function () {
590
+ overlapApplyTest("modify", [[3, "abc", "123"]], [[3, "def", "abc"]], [[3, "def", "123"]]);
530
591
  });
531
- describe('for overlapping modifies 2', function () {
532
- overlapApplyTest('modify', [[0, 'abc', '123']], [[2, 'def', 'c45']], [[0, 'abdef', '12345']]);
592
+ describe("for overlapping modifies 2", function () {
593
+ overlapApplyTest("modify", [[0, "abc", "123"]], [[2, "def", "c45"]], [[0, "abdef", "12345"]]);
533
594
  });
534
595
  });
535
- describe('Rebase with reversible ChangeSets', function () {
596
+ describe("Rebase with reversible ChangeSets", function () {
536
597
  var overlapRebaseTest = function (in_type, in_inputArrayOperations1, in_inputArrayOperations2, in_outputArrayOperations, in_expectedConflicts) {
537
598
  var convertModificationSetToArray = function (in_modificationSet) {
538
599
  return in_modificationSet.map((x) => {
539
- return x[2] === undefined ?
540
- [x[0], x[1].split('')] :
541
- [x[0], x[1].split(''), x[2].split('')];
600
+ return x[2] === undefined
601
+ ? [x[0], x[1].split("")]
602
+ : [x[0], x[1].split(""), x[2].split("")];
542
603
  });
543
604
  };
544
605
  var performRebaseTest = function (in_typeid, inputArrayOperations1, inputArrayOperations2, outputArrayOperations) {
545
606
  var conflicts = [];
546
- var CS1_initial = { 'modify': { [in_typeid]: { 'arr': { [in_type]: inputArrayOperations1 } } } };
607
+ var CS1_initial = {
608
+ modify: { [in_typeid]: { arr: { [in_type]: inputArrayOperations1 } } },
609
+ };
547
610
  var CS1 = new ChangeSet(deepCopy(CS1_initial));
548
- var CS2 = { 'modify': { [in_typeid]: { 'arr': { [in_type]: inputArrayOperations2 } } } };
611
+ var CS2 = {
612
+ modify: { [in_typeid]: { arr: { [in_type]: inputArrayOperations2 } } },
613
+ };
549
614
  CS1._rebaseChangeSet(CS2, conflicts);
550
615
  // Duplicated remove is not a conflict
551
616
  expect(conflicts.length).to.equal(in_expectedConflicts);
552
617
  // CS1 should be unchanged
553
618
  expect(CS1.getSerializedChangeSet()).to.deep.equal(CS1_initial);
554
619
  // CS2 should no longer contain the removal of A
555
- expect(CS2).to.deep.equal({ 'modify': { [in_typeid]: { 'arr': { [in_type]: outputArrayOperations } } } });
620
+ expect(CS2).to.deep.equal({
621
+ modify: { [in_typeid]: { arr: { [in_type]: outputArrayOperations } } },
622
+ });
556
623
  };
557
- it('on strings', function () {
558
- performRebaseTest('String', in_inputArrayOperations1, in_inputArrayOperations2, in_outputArrayOperations);
624
+ it("on strings", function () {
625
+ performRebaseTest("String", in_inputArrayOperations1, in_inputArrayOperations2, in_outputArrayOperations);
559
626
  });
560
- it('on arrays', function () {
561
- performRebaseTest('array<String>', convertModificationSetToArray(in_inputArrayOperations1), convertModificationSetToArray(in_inputArrayOperations2), convertModificationSetToArray(in_outputArrayOperations));
627
+ it("on arrays", function () {
628
+ performRebaseTest("array<String>", convertModificationSetToArray(in_inputArrayOperations1), convertModificationSetToArray(in_inputArrayOperations2), convertModificationSetToArray(in_outputArrayOperations));
562
629
  });
563
630
  };
564
- describe('for overlapping removes', function () {
565
- overlapRebaseTest('remove', [[0, '<A'], [4, '>']], [[1, 'ABC']], [[0, 'BC']], 0);
566
- });
567
- describe('for overlapping removes 2', function () {
568
- overlapRebaseTest('remove', [[2, 'C>']], [[0, 'ABC']], [[0, 'AB']], 0);
569
- });
570
- describe('for overlapping removes 3', function () {
571
- overlapRebaseTest('remove', [[2, 'CD>']], [[0, 'ABC'], [4, '>']], [[0, 'AB']], 0);
572
- });
573
- describe('for overlapping modifies', function () {
574
- overlapRebaseTest('modify', [[0, '<A', '..'], [4, '>', '.']], [[1, '123', '---']], [[1, '123', 'A--']], 1);
575
- });
576
- describe('for overlapping modifies 2', function () {
577
- overlapRebaseTest('modify', [[2, 'C>', '..']], [[0, '123', '---']], [[0, '123', '--C']], 1);
578
- });
579
- describe('for overlapping modifies 3', function () {
580
- overlapRebaseTest('modify', [[2, 'CD>', '..']], [[0, '123', '---'], [4, '45', '--']], [[0, '123', '--C'], [4, '45', '>-']], 2);
581
- });
582
- it('for array modify rebases', function () {
631
+ describe("for overlapping removes", function () {
632
+ overlapRebaseTest("remove", [
633
+ [0, "<A"],
634
+ [4, ">"],
635
+ ], [[1, "ABC"]], [[0, "BC"]], 0);
636
+ });
637
+ describe("for overlapping removes 2", function () {
638
+ overlapRebaseTest("remove", [[2, "C>"]], [[0, "ABC"]], [[0, "AB"]], 0);
639
+ });
640
+ describe("for overlapping removes 3", function () {
641
+ overlapRebaseTest("remove", [[2, "CD>"]], [
642
+ [0, "ABC"],
643
+ [4, ">"],
644
+ ], [[0, "AB"]], 0);
645
+ });
646
+ describe("for overlapping modifies", function () {
647
+ overlapRebaseTest("modify", [
648
+ [0, "<A", ".."],
649
+ [4, ">", "."],
650
+ ], [[1, "123", "---"]], [[1, "123", "A--"]], 1);
651
+ });
652
+ describe("for overlapping modifies 2", function () {
653
+ overlapRebaseTest("modify", [[2, "C>", ".."]], [[0, "123", "---"]], [[0, "123", "--C"]], 1);
654
+ });
655
+ describe("for overlapping modifies 3", function () {
656
+ overlapRebaseTest("modify", [[2, "CD>", ".."]], [
657
+ [0, "123", "---"],
658
+ [4, "45", "--"],
659
+ ], [
660
+ [0, "123", "--C"],
661
+ [4, "45", ">-"],
662
+ ], 2);
663
+ });
664
+ it("for array modify rebases", function () {
583
665
  var CS = new ChangeSet({
584
- 'array<Float32>': {
585
- 'elements': {
586
- 'modify': [
587
- [1, [1, 2, 3], [0, 1, 2]],
588
- ],
666
+ "array<Float32>": {
667
+ elements: {
668
+ modify: [[1, [1, 2, 3], [0, 1, 2]]],
589
669
  },
590
670
  },
591
671
  });
592
672
  var rebasedCS = CS._rebaseChangeSet({
593
- 'array<Float32>': {
594
- 'elements': {
595
- 'modify': [
596
- [
597
- 0,
598
- [0, 1, 2, 3],
599
- [1, 2, 3, 4],
600
- ],
601
- ],
673
+ "array<Float32>": {
674
+ elements: {
675
+ modify: [[0, [0, 1, 2, 3], [1, 2, 3, 4]]],
602
676
  },
603
677
  },
604
678
  }, []);
605
- expect(rebasedCS['array<Float32>'].elements.modify[0].length).to.equal(3);
679
+ expect(rebasedCS["array<Float32>"].elements.modify[0].length).to.equal(3);
606
680
  });
607
681
  });
608
- describe('applying reversible CS to primitive string types', function () {
609
- it('should work for strings', function () {
610
- var CS = new ChangeSet({ 'String': { 'test': { 'value': '10', 'oldValue': '9' } } });
611
- CS.applyChangeSet({ 'String': { 'test': { 'value': '8', 'oldValue': '10' } } });
612
- expect(CS.getSerializedChangeSet()).to.deep.equal({ 'String': { 'test': { 'value': '8', 'oldValue': '9' } } });
613
- });
614
- it('should work for strings', function () {
615
- var CS = new ChangeSet({ 'Float64': { 'test': { 'value': 10, 'oldValue': 9 } } });
616
- CS.applyChangeSet({ 'Float64': { 'test': { 'value': 8, 'oldValue': 10 } } });
617
- expect(CS.getSerializedChangeSet()).to.deep.equal({ 'Float64': { 'test': { 'value': 8, 'oldValue': 9 } } });
618
- });
619
- it('should work for bool', function () {
682
+ describe("applying reversible CS to primitive string types", function () {
683
+ it("should work for strings", function () {
684
+ var CS = new ChangeSet({ String: { test: { value: "10", oldValue: "9" } } });
685
+ CS.applyChangeSet({ String: { test: { value: "8", oldValue: "10" } } });
686
+ expect(CS.getSerializedChangeSet()).to.deep.equal({
687
+ String: { test: { value: "8", oldValue: "9" } },
688
+ });
689
+ });
690
+ it("should work for strings", function () {
691
+ var CS = new ChangeSet({ Float64: { test: { value: 10, oldValue: 9 } } });
692
+ CS.applyChangeSet({ Float64: { test: { value: 8, oldValue: 10 } } });
693
+ expect(CS.getSerializedChangeSet()).to.deep.equal({
694
+ Float64: { test: { value: 8, oldValue: 9 } },
695
+ });
696
+ });
697
+ it("should work for bool", function () {
620
698
  // TODO: This should become a NOP
621
- var CS = new ChangeSet({ 'Bool': { 'test': { 'value': false, 'oldValue': true } } });
622
- CS.applyChangeSet({ 'Bool': { 'test': { 'value': true, 'oldValue': false } } });
623
- expect(CS.getSerializedChangeSet()).to.deep.equal({ 'Bool': { 'test': { 'value': true, 'oldValue': true } } });
699
+ var CS = new ChangeSet({ Bool: { test: { value: false, oldValue: true } } });
700
+ CS.applyChangeSet({ Bool: { test: { value: true, oldValue: false } } });
701
+ expect(CS.getSerializedChangeSet()).to.deep.equal({
702
+ Bool: { test: { value: true, oldValue: true } },
703
+ });
624
704
  });
625
- it('should work for bool', function () {
705
+ it("should work for bool", function () {
626
706
  // TODO: This should become a NOP
627
707
  var CS = new ChangeSet({});
628
- CS.applyChangeSet({ 'Bool': { 'test': { 'value': true, 'oldValue': false } } });
629
- expect(CS.getSerializedChangeSet()).to.deep.equal({ 'Bool': { 'test': { 'value': true, 'oldValue': false } } });
708
+ CS.applyChangeSet({ Bool: { test: { value: true, oldValue: false } } });
709
+ expect(CS.getSerializedChangeSet()).to.deep.equal({
710
+ Bool: { test: { value: true, oldValue: false } },
711
+ });
630
712
  });
631
713
  });
632
- describe('_stripReversibleChangeSet should', function () {
633
- it('correctly handle removes at the root', function () {
714
+ describe("_stripReversibleChangeSet should", function () {
715
+ it("correctly handle removes at the root", function () {
634
716
  var CS = new ChangeSet({
635
717
  remove: {
636
718
  String: {
637
- testString: 'abcde',
719
+ testString: "abcde",
638
720
  },
639
721
  },
640
722
  });
641
723
  CS._stripReversibleChangeSet();
642
724
  expect(CS.getSerializedChangeSet()).to.deep.equal({
643
- remove: ['testString'],
725
+ remove: ["testString"],
644
726
  });
645
727
  });
646
- it('ignore the root when passing it a flag', function () {
728
+ it("ignore the root when passing it a flag", function () {
647
729
  var SCS = {
648
730
  remove: {
649
731
  String: {
650
- testString: 'abcde',
732
+ testString: "abcde",
651
733
  },
652
734
  },
653
735
  };
@@ -656,118 +738,132 @@ describe('Reversible ChangeSets', function () {
656
738
  expect(CS.getSerializedChangeSet()).to.deep.equal(SCS);
657
739
  });
658
740
  });
659
- describe('should return a minimal CS when squashing', function () {
660
- it('matching primitive type remove/insert combinations in a polymorphic indexed collection', function () {
741
+ describe("should return a minimal CS when squashing", function () {
742
+ it("matching primitive type remove/insert combinations in a polymorphic indexed collection", function () {
661
743
  // These two operations should cancel out
662
- var CS1 = new ChangeSet({ remove: { String: { A: 'A' } } });
663
- var CS2 = new ChangeSet({ insert: { String: { A: 'A' } } });
744
+ var CS1 = new ChangeSet({ remove: { String: { A: "A" } } });
745
+ var CS2 = new ChangeSet({ insert: { String: { A: "A" } } });
664
746
  CS1.applyChangeSet(CS2);
665
747
  expect(CS1.getSerializedChangeSet()).to.deep.equal({});
666
748
  });
667
- it('non matching primitive type remove/insert combinations in a polymorphic indexed collection', function () {
749
+ it("non matching primitive type remove/insert combinations in a polymorphic indexed collection", function () {
668
750
  // These two operations should result in a modify
669
- var CS1 = new ChangeSet({ remove: { String: { A: 'A' } } });
670
- var CS2 = new ChangeSet({ insert: { String: { A: 'B' } } });
751
+ var CS1 = new ChangeSet({ remove: { String: { A: "A" } } });
752
+ var CS2 = new ChangeSet({ insert: { String: { A: "B" } } });
671
753
  CS1.applyChangeSet(CS2);
672
- expect(CS1.getSerializedChangeSet()).to.deep.equal({ modify: { String: { A: 'B' } } });
754
+ expect(CS1.getSerializedChangeSet()).to.deep.equal({ modify: { String: { A: "B" } } });
673
755
  });
674
- it('matching remove/insert combinations in a primitive type indexed collection', function () {
756
+ it("matching remove/insert combinations in a primitive type indexed collection", function () {
675
757
  // These two operations should cancel out
676
- var CS1 = new ChangeSet({ modify: { 'map<String>': { test: { remove: { A: 'A' } } } } });
677
- var CS2 = new ChangeSet({ modify: { 'map<String>': { test: { insert: { A: 'A' } } } } });
758
+ var CS1 = new ChangeSet({
759
+ modify: { "map<String>": { test: { remove: { A: "A" } } } },
760
+ });
761
+ var CS2 = new ChangeSet({
762
+ modify: { "map<String>": { test: { insert: { A: "A" } } } },
763
+ });
678
764
  CS1.applyChangeSet(CS2);
679
765
  expect(CS1.getSerializedChangeSet()).to.deep.equal({});
680
766
  });
681
- it('non matching primitive type remove/insert combinations in a polymorphic indexed collection', function () {
767
+ it("non matching primitive type remove/insert combinations in a polymorphic indexed collection", function () {
682
768
  // These two operations should result in a modify
683
- var CS1 = new ChangeSet({ modify: { 'map<String>': { test: { remove: { A: 'A' } } } } });
684
- var CS2 = new ChangeSet({ modify: { 'map<String>': { test: { insert: { A: 'B' } } } } });
769
+ var CS1 = new ChangeSet({
770
+ modify: { "map<String>": { test: { remove: { A: "A" } } } },
771
+ });
772
+ var CS2 = new ChangeSet({
773
+ modify: { "map<String>": { test: { insert: { A: "B" } } } },
774
+ });
685
775
  CS1.applyChangeSet(CS2);
686
- expect(CS1.getSerializedChangeSet()).to.deep.equal({ modify: { 'map<String>': { test: { modify: { A: 'B' } } } } });
776
+ expect(CS1.getSerializedChangeSet()).to.deep.equal({
777
+ modify: { "map<String>": { test: { modify: { A: "B" } } } },
778
+ });
687
779
  });
688
- it('matching complex type remove/insert combinations in a polymorphic indexed collection', function () {
780
+ it("matching complex type remove/insert combinations in a polymorphic indexed collection", function () {
689
781
  // These two operations should cancel out
690
- var CS1 = new ChangeSet({ remove: { 'RepositoryTest:Nametag-1.0.0': { name: 'A' } } });
691
- var CS2 = new ChangeSet({ insert: { 'RepositoryTest:Nametag-1.0.0': { name: 'A' } } });
782
+ var CS1 = new ChangeSet({ remove: { "RepositoryTest:Nametag-1.0.0": { name: "A" } } });
783
+ var CS2 = new ChangeSet({ insert: { "RepositoryTest:Nametag-1.0.0": { name: "A" } } });
692
784
  CS1.applyChangeSet(CS2);
693
785
  expect(CS1.getSerializedChangeSet()).to.deep.equal({});
694
786
  });
695
- it('non matching complex type remove/insert combinations in a polymorphic indexed collection', function () {
787
+ it("non matching complex type remove/insert combinations in a polymorphic indexed collection", function () {
696
788
  // TODO: How should we treat these operations? Should they be rewritten to a modify?
697
- var CS1 = new ChangeSet({ remove: { 'RepositoryTest:Nametag-1.0.0': { name: 'A' } } });
698
- var CS2 = new ChangeSet({ insert: { 'RepositoryTest:Nametag-1.0.0': { name: 'B' } } });
789
+ var CS1 = new ChangeSet({ remove: { "RepositoryTest:Nametag-1.0.0": { name: "A" } } });
790
+ var CS2 = new ChangeSet({ insert: { "RepositoryTest:Nametag-1.0.0": { name: "B" } } });
699
791
  CS1.applyChangeSet(CS2);
700
792
  expect(CS1.getSerializedChangeSet()).to.deep.equal({
701
- remove: { 'RepositoryTest:Nametag-1.0.0': { name: 'A' } },
702
- insert: { 'RepositoryTest:Nametag-1.0.0': { name: 'B' } },
793
+ remove: { "RepositoryTest:Nametag-1.0.0": { name: "A" } },
794
+ insert: { "RepositoryTest:Nametag-1.0.0": { name: "B" } },
703
795
  });
704
796
  });
705
- it('matching primitive type remove/insert operations in primitive type arrays', function () {
797
+ it("matching primitive type remove/insert operations in primitive type arrays", function () {
706
798
  // These two operations should cancel out
707
- var CS1 = new ChangeSet({ modify: { 'array<String>': { test: { remove: [[0, ['A', 'B', 'C']]] } } } });
708
- var CS2 = new ChangeSet({ modify: { 'array<String>': { test: { insert: [[0, ['A', 'B', 'C']]] } } } });
799
+ var CS1 = new ChangeSet({
800
+ modify: { "array<String>": { test: { remove: [[0, ["A", "B", "C"]]] } } },
801
+ });
802
+ var CS2 = new ChangeSet({
803
+ modify: { "array<String>": { test: { insert: [[0, ["A", "B", "C"]]] } } },
804
+ });
709
805
  CS1.applyChangeSet(CS2);
710
806
  expect(CS1.getSerializedChangeSet()).to.deep.equal({});
711
807
  });
712
808
  });
713
- it('should work for primitive array properties', function () {
714
- var prop = PropertyFactory.create('autodesk.test:test.arrayfloat32-1.0.0');
809
+ it("should work for primitive array properties", function () {
810
+ var prop = PropertyFactory.create("autodesk.test:test.arrayfloat32-1.0.0");
715
811
  prop._properties.data.insertRange(0, [10, 11, 12, 13, 14, 15, 16]);
716
812
  testRevAndInvCS(prop, function (in_prop) {
717
813
  in_prop._properties.data.setRange(1, [21, 22]);
718
814
  in_prop._properties.data.removeRange(4, 3);
719
815
  in_prop._properties.data.insert(0, 9);
720
816
  }, {
721
- 'array<Float32>': {
722
- 'data': {
723
- 'modify': [[1, [21, 22], [11, 12]]],
724
- 'remove': [[4, [14, 15, 16]]],
725
- 'insert': [[0, [9]]],
817
+ "array<Float32>": {
818
+ data: {
819
+ modify: [[1, [21, 22], [11, 12]]],
820
+ remove: [[4, [14, 15, 16]]],
821
+ insert: [[0, [9]]],
726
822
  },
727
823
  },
728
824
  }, {
729
- 'array<Float32>': {
730
- 'data': {
731
- 'insert': [[0, [9, 10, 21, 22, 13]]],
825
+ "array<Float32>": {
826
+ data: {
827
+ insert: [[0, [9, 10, 21, 22, 13]]],
732
828
  },
733
829
  },
734
830
  }, {
735
- 'array<Float32>': {
736
- 'data': {
737
- 'modify': [[2, [11, 12], [21, 22]]],
738
- 'insert': [[5, [14, 15, 16]]],
739
- 'remove': [[0, [9]]],
831
+ "array<Float32>": {
832
+ data: {
833
+ modify: [[2, [11, 12], [21, 22]]],
834
+ insert: [[5, [14, 15, 16]]],
835
+ remove: [[0, [9]]],
740
836
  },
741
837
  },
742
838
  });
743
839
  });
744
- it('should work for insertions into empty primitive array properties', function () {
745
- var prop = PropertyFactory.create('autodesk.test:test.arrayfloat32-1.0.0');
840
+ it("should work for insertions into empty primitive array properties", function () {
841
+ var prop = PropertyFactory.create("autodesk.test:test.arrayfloat32-1.0.0");
746
842
  testRevAndInvCS(prop, function (in_prop) {
747
843
  in_prop._properties.data.insertRange(0, [1, 2, 3]);
748
844
  }, {
749
- 'array<Float32>': {
750
- 'data': {
751
- 'insert': [[0, [1, 2, 3]]],
845
+ "array<Float32>": {
846
+ data: {
847
+ insert: [[0, [1, 2, 3]]],
752
848
  },
753
849
  },
754
850
  }, {
755
- 'array<Float32>': {
756
- 'data': {
757
- 'insert': [[0, [1, 2, 3]]],
851
+ "array<Float32>": {
852
+ data: {
853
+ insert: [[0, [1, 2, 3]]],
758
854
  },
759
855
  },
760
856
  }, {
761
- 'array<Float32>': {
762
- 'data': {
763
- 'remove': [[0, [1, 2, 3]]],
857
+ "array<Float32>": {
858
+ data: {
859
+ remove: [[0, [1, 2, 3]]],
764
860
  },
765
861
  },
766
862
  });
767
863
  });
768
- it('should not crash with an empty input if it is not needed in the actual CS', function () {
864
+ it("should not crash with an empty input if it is not needed in the actual CS", function () {
769
865
  var initialCS = {
770
- 'NodeProperty': {
866
+ NodeProperty: {
771
867
  insert: {
772
868
  NodeProperty: {
773
869
  test2: {},
@@ -779,14 +875,14 @@ describe('Reversible ChangeSets', function () {
779
875
  CS._toReversibleChangeSet({});
780
876
  expect(CS.getSerializedChangeSet()).to.deep.equal(initialCS);
781
877
  });
782
- it('should work for inserts, even if the corresponding property is missing in the initial state', function () {
878
+ it("should work for inserts, even if the corresponding property is missing in the initial state", function () {
783
879
  // This test checks, whether changesets with insert work, even if the corresponding property is not present in the
784
880
  // initial changeset. Since the initial changeset is not needed for the insert, we don't need to throw an
785
881
  // error in that case. This type of situation can occur in the materialized history, if an insert happens right
786
882
  // at a chunk boundary.
787
883
  var initialCS = {
788
- 'NodeProperty': {
789
- 'test': {
884
+ NodeProperty: {
885
+ test: {
790
886
  insert: {
791
887
  NodeProperty: {
792
888
  test2: {},
@@ -799,18 +895,18 @@ describe('Reversible ChangeSets', function () {
799
895
  CS._toReversibleChangeSet({});
800
896
  expect(CS.getSerializedChangeSet()).to.deep.equal(initialCS);
801
897
  });
802
- it('should work for simple primitive properties', function () {
898
+ it("should work for simple primitive properties", function () {
803
899
  var cs = new ChangeSet({
804
900
  insert: {
805
- 'Float32': {
806
- 'myFloat': 23,
901
+ Float32: {
902
+ myFloat: 23,
807
903
  },
808
904
  },
809
905
  });
810
906
  var cs2 = new ChangeSet({
811
907
  modify: {
812
- 'Float32': {
813
- 'myFloat': 42,
908
+ Float32: {
909
+ myFloat: 42,
814
910
  },
815
911
  },
816
912
  });
@@ -821,207 +917,247 @@ describe('Reversible ChangeSets', function () {
821
917
  var cs2Strip = cs2Rev.clone();
822
918
  cs2Strip._stripReversibleChangeSet();
823
919
  expect(cs2.getSerializedChangeSet()).to.deep.equal(cs2Strip.getSerializedChangeSet());
824
- expect(cs2Rev.getSerializedChangeSet()).to.deep.equal({ 'modify': { 'Float32': { 'myFloat': { 'value': 42, 'oldValue': 23 } } } });
920
+ expect(cs2Rev.getSerializedChangeSet()).to.deep.equal({
921
+ modify: { Float32: { myFloat: { value: 42, oldValue: 23 } } },
922
+ });
825
923
  // forward and reverse:
826
924
  cs.applyChangeSet(cs2Rev);
827
925
  // cs now should be 42
828
- expect(cs.getSerializedChangeSet()).to.deep.equal({ 'insert': { 'Float32': { 'myFloat': 42 } } });
926
+ expect(cs.getSerializedChangeSet()).to.deep.equal({ insert: { Float32: { myFloat: 42 } } });
829
927
  var invCS = cs2Rev.clone();
830
928
  invCS.toInverseChangeSet();
831
- expect(invCS.getSerializedChangeSet()).to.deep.equal({ 'modify': { 'Float32': { 'myFloat': { 'value': 23, 'oldValue': 42 } } } });
929
+ expect(invCS.getSerializedChangeSet()).to.deep.equal({
930
+ modify: { Float32: { myFloat: { value: 23, oldValue: 42 } } },
931
+ });
832
932
  cs.applyChangeSet(invCS);
833
933
  // cs now should be 23
834
- expect(cs.getSerializedChangeSet()).to.deep.equal({ 'insert': { 'Float32': { 'myFloat': 23 } } });
934
+ expect(cs.getSerializedChangeSet()).to.deep.equal({ insert: { Float32: { myFloat: 23 } } });
835
935
  });
836
- it('should work for templated properties', function () {
837
- var prop = PropertyFactory.create('autodesk.test:point2d-1.0.0');
936
+ it("should work for templated properties", function () {
937
+ var prop = PropertyFactory.create("autodesk.test:point2d-1.0.0");
838
938
  testRevAndInvCS(prop, function (in_prop) {
839
939
  in_prop._properties.position.x.value = 2;
840
940
  in_prop._properties.normal.y.value = 4;
841
941
  in_prop._properties.temperature.value = 21;
842
942
  }, {
843
- 'Float32': {
844
- 'position.x': { 'value': 2, 'oldValue': 0 },
845
- 'temperature': { 'value': 21, 'oldValue': 0 },
943
+ "Float32": {
944
+ "position.x": { value: 2, oldValue: 0 },
945
+ "temperature": { value: 21, oldValue: 0 },
846
946
  },
847
- 'autodesk.test:vector3-1.0.0': {
848
- 'normal': { 'Float32': { 'y': { 'value': 4, 'oldValue': 0 } } },
947
+ "autodesk.test:vector3-1.0.0": {
948
+ normal: { Float32: { y: { value: 4, oldValue: 0 } } },
849
949
  },
850
950
  }, {
851
- 'Float32': {
852
- 'position.x': 2, 'position.y': 0, 'temperature': 21,
951
+ "Float32": {
952
+ "position.x": 2,
953
+ "position.y": 0,
954
+ "temperature": 21,
853
955
  },
854
- 'autodesk.test:vector3-1.0.0': {
855
- 'normal': { 'Float32': { 'x': 0, 'y': 4, 'z': 0 } },
956
+ "autodesk.test:vector3-1.0.0": {
957
+ normal: { Float32: { x: 0, y: 4, z: 0 } },
856
958
  },
857
- 'map<autodesk.test:vector3-1.0.0>': { 'neighbours': {} },
959
+ "map<autodesk.test:vector3-1.0.0>": { neighbours: {} },
858
960
  }, {
859
- 'Float32': {
860
- 'position.x': { 'value': 0, 'oldValue': 2 },
861
- 'temperature': { 'value': 0, 'oldValue': 21 },
961
+ "Float32": {
962
+ "position.x": { value: 0, oldValue: 2 },
963
+ "temperature": { value: 0, oldValue: 21 },
862
964
  },
863
- 'autodesk.test:vector3-1.0.0': {
864
- 'normal': { 'Float32': { 'y': { 'value': 0, 'oldValue': 4 } } },
965
+ "autodesk.test:vector3-1.0.0": {
966
+ normal: { Float32: { y: { value: 0, oldValue: 4 } } },
865
967
  },
866
968
  });
867
969
  });
868
- it('should work for string properties initialized by set', function () {
869
- var prop = PropertyFactory.create('autodesk.tests:DataStringTestProperty-1.0.0');
870
- prop._properties.data.value = 'Hello world';
970
+ it("should work for string properties initialized by set", function () {
971
+ var prop = PropertyFactory.create("autodesk.tests:DataStringTestProperty-1.0.0");
972
+ prop._properties.data.value = "Hello world";
871
973
  testRevAndInvCS(prop, function (in_prop) {
872
- in_prop._properties.data.setRange(1, 'aih');
974
+ in_prop._properties.data.setRange(1, "aih");
873
975
  in_prop._properties.data.removeRange(6, 5);
874
- in_prop._properties.data.insertRange(0, 'Hi, ');
875
- }, { 'String': { 'data': { 'modify': [[1, 'aih', 'ell']], 'remove': [[6, 'world']], 'insert': [[0, 'Hi, ']] } } }, { 'String': { 'data': 'Hi, Haiho ' } }, { 'String': { 'data': { 'modify': [[5, 'ell', 'aih']], 'remove': [[0, 'Hi, ']], 'insert': [[10, 'world']] } } });
976
+ in_prop._properties.data.insertRange(0, "Hi, ");
977
+ }, {
978
+ String: {
979
+ data: {
980
+ modify: [[1, "aih", "ell"]],
981
+ remove: [[6, "world"]],
982
+ insert: [[0, "Hi, "]],
983
+ },
984
+ },
985
+ }, { String: { data: "Hi, Haiho " } }, {
986
+ String: {
987
+ data: {
988
+ modify: [[5, "ell", "aih"]],
989
+ remove: [[0, "Hi, "]],
990
+ insert: [[10, "world"]],
991
+ },
992
+ },
993
+ });
876
994
  });
877
- it('should work for string properties initialized by insert', function () {
878
- var prop = PropertyFactory.create('autodesk.tests:DataStringTestProperty-1.0.0');
879
- prop._properties.data.insert(0, 'Hello world');
995
+ it("should work for string properties initialized by insert", function () {
996
+ var prop = PropertyFactory.create("autodesk.tests:DataStringTestProperty-1.0.0");
997
+ prop._properties.data.insert(0, "Hello world");
880
998
  testRevAndInvCS(prop, function (in_prop) {
881
- in_prop._properties.data.setRange(1, 'aih');
999
+ in_prop._properties.data.setRange(1, "aih");
882
1000
  in_prop._properties.data.removeRange(6, 5);
883
- in_prop._properties.data.insertRange(0, 'Hi, ');
884
- }, { 'String': { 'data': { 'modify': [[1, 'aih', 'ell']], 'remove': [[6, 'world']], 'insert': [[0, 'Hi, ']] } } }, { 'String': { 'data': 'Hi, Haiho ' } }, { 'String': { 'data': { 'modify': [[5, 'ell', 'aih']], 'remove': [[0, 'Hi, ']], 'insert': [[10, 'world']] } } });
1001
+ in_prop._properties.data.insertRange(0, "Hi, ");
1002
+ }, {
1003
+ String: {
1004
+ data: {
1005
+ modify: [[1, "aih", "ell"]],
1006
+ remove: [[6, "world"]],
1007
+ insert: [[0, "Hi, "]],
1008
+ },
1009
+ },
1010
+ }, { String: { data: "Hi, Haiho " } }, {
1011
+ String: {
1012
+ data: {
1013
+ modify: [[5, "ell", "aih"]],
1014
+ remove: [[0, "Hi, "]],
1015
+ insert: [[10, "world"]],
1016
+ },
1017
+ },
1018
+ });
885
1019
  });
886
- it('should work for primitive map properties', function () {
887
- var property = PropertyFactory.create('autodesk.tests:MapTestPropertyID-1.0.0');
1020
+ it("should work for primitive map properties", function () {
1021
+ var property = PropertyFactory.create("autodesk.tests:MapTestPropertyID-1.0.0");
888
1022
  var prop = property._properties.data;
889
- prop.insert('A', 3);
890
- prop.insert('B', 4);
891
- prop.insert('C', 5);
892
- prop.insert('D', 6);
1023
+ prop.insert("A", 3);
1024
+ prop.insert("B", 4);
1025
+ prop.insert("C", 5);
1026
+ prop.insert("D", 6);
893
1027
  testRevAndInvCS(property, function (myProp) {
894
- myProp._properties.data.set('A', 7);
895
- myProp._properties.data.remove('B');
896
- myProp._properties.data.remove('C');
897
- myProp._properties.data.set('D', 8);
898
- myProp._properties.data.insert('F', 9);
1028
+ myProp._properties.data.set("A", 7);
1029
+ myProp._properties.data.remove("B");
1030
+ myProp._properties.data.remove("C");
1031
+ myProp._properties.data.set("D", 8);
1032
+ myProp._properties.data.insert("F", 9);
899
1033
  }, {
900
- 'map<Float32>': {
901
- 'data': {
902
- 'remove': { 'B': 4, 'C': 5 },
903
- 'modify': { 'A': { 'value': 7, 'oldValue': 3 }, 'D': { 'value': 8, 'oldValue': 6 } },
904
- 'insert': { 'F': 9 },
1034
+ "map<Float32>": {
1035
+ data: {
1036
+ remove: { B: 4, C: 5 },
1037
+ modify: { A: { value: 7, oldValue: 3 }, D: { value: 8, oldValue: 6 } },
1038
+ insert: { F: 9 },
905
1039
  },
906
1040
  },
907
1041
  }, {
908
- 'map<Float32>': {
909
- 'data': {
910
- 'insert': { 'A': 7, 'D': 8, 'F': 9 },
1042
+ "map<Float32>": {
1043
+ data: {
1044
+ insert: { A: 7, D: 8, F: 9 },
911
1045
  },
912
1046
  },
913
1047
  }, {
914
- 'map<Float32>': {
915
- 'data': {
916
- 'modify': { 'A': { 'value': 3, 'oldValue': 7 }, 'D': { 'value': 6, 'oldValue': 8 } },
917
- 'insert': { 'B': 4, 'C': 5 },
918
- 'remove': { 'F': 9 },
1048
+ "map<Float32>": {
1049
+ data: {
1050
+ modify: { A: { value: 3, oldValue: 7 }, D: { value: 6, oldValue: 8 } },
1051
+ insert: { B: 4, C: 5 },
1052
+ remove: { F: 9 },
919
1053
  },
920
1054
  },
921
1055
  });
922
1056
  });
923
- it('should work for custom map properties', function () {
924
- var rootNode = PropertyFactory.create('autodesk.tests:MapTestNamedPropertyID-1.0.0');
925
- var A = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
926
- var B = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
927
- var C = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
928
- var D = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
929
- rootNode._properties.map.insert('A', A);
930
- rootNode._properties.map.insert('B', B);
931
- rootNode._properties.map.insert('C', C);
932
- rootNode._properties.map.insert('D', D);
1057
+ it("should work for custom map properties", function () {
1058
+ var rootNode = PropertyFactory.create("autodesk.tests:MapTestNamedPropertyID-1.0.0");
1059
+ var A = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
1060
+ var B = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
1061
+ var C = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
1062
+ var D = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
1063
+ rootNode._properties.map.insert("A", A);
1064
+ rootNode._properties.map.insert("B", B);
1065
+ rootNode._properties.map.insert("C", C);
1066
+ rootNode._properties.map.insert("D", D);
933
1067
  testRevAndInvCS(rootNode, function (myProp) {
934
- var F = PropertyFactory.create('autodesk.tests:AnonymousMapTestPropertyID-1.0.0');
935
- myProp._properties.map.remove('B');
936
- myProp._properties.map.remove('C');
937
- myProp._properties.map.insert('F', F);
938
- myProp._properties.map.get('A')._properties.stringProperty.value = 'hello';
1068
+ var F = PropertyFactory.create("autodesk.tests:AnonymousMapTestPropertyID-1.0.0");
1069
+ myProp._properties.map.remove("B");
1070
+ myProp._properties.map.remove("C");
1071
+ myProp._properties.map.insert("F", F);
1072
+ myProp._properties.map.get("A")._properties.stringProperty.value = "hello";
939
1073
  }, {
940
- 'map<NamedProperty>': {
941
- 'map': {
942
- 'insert': {
943
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
944
- 'F': { 'String': { 'stringProperty': '' } },
1074
+ "map<NamedProperty>": {
1075
+ map: {
1076
+ insert: {
1077
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1078
+ F: { String: { stringProperty: "" } },
945
1079
  },
946
1080
  },
947
- 'remove': {
948
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
949
- 'B': { 'String': { 'stringProperty': '' } }, 'C': { 'String': { 'stringProperty': '' } },
1081
+ remove: {
1082
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1083
+ B: { String: { stringProperty: "" } },
1084
+ C: { String: { stringProperty: "" } },
950
1085
  },
951
1086
  },
952
- 'modify': {
953
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
954
- 'A': { 'String': { 'stringProperty': { 'value': 'hello', 'oldValue': '' } } },
1087
+ modify: {
1088
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1089
+ A: { String: { stringProperty: { value: "hello", oldValue: "" } } },
955
1090
  },
956
1091
  },
957
1092
  },
958
1093
  },
959
1094
  }, undefined, {
960
- 'map<NamedProperty>': {
961
- 'map': {
962
- 'insert': {
963
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
964
- 'B': { 'String': { 'stringProperty': '' } },
965
- 'C': { 'String': { 'stringProperty': '' } },
1095
+ "map<NamedProperty>": {
1096
+ map: {
1097
+ insert: {
1098
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1099
+ B: { String: { stringProperty: "" } },
1100
+ C: { String: { stringProperty: "" } },
966
1101
  },
967
1102
  },
968
- 'modify': {
969
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
970
- 'A': { 'String': { 'stringProperty': { 'value': '', 'oldValue': 'hello' } } },
1103
+ modify: {
1104
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1105
+ A: { String: { stringProperty: { value: "", oldValue: "hello" } } },
971
1106
  },
972
1107
  },
973
- 'remove': {
974
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
975
- 'F': { 'String': { 'stringProperty': '' } },
1108
+ remove: {
1109
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1110
+ F: { String: { stringProperty: "" } },
976
1111
  },
977
1112
  },
978
1113
  },
979
1114
  },
980
1115
  });
981
1116
  });
982
- it('should test reversible changeset for a NodeProperty', function () {
1117
+ it("should test reversible changeset for a NodeProperty", function () {
983
1118
  var originalChangeSet = {
984
- 'insert': {
985
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
986
- 'F': { 'String': { 'stringProperty': '' } },
1119
+ insert: {
1120
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1121
+ F: { String: { stringProperty: "" } },
987
1122
  },
988
1123
  },
989
- 'remove': ['B', 'C'],
990
- 'modify': {
991
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
992
- 'A': { 'String': { 'stringProperty': 'hello' } },
1124
+ remove: ["B", "C"],
1125
+ modify: {
1126
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1127
+ A: { String: { stringProperty: "hello" } },
993
1128
  },
994
1129
  },
995
1130
  };
996
1131
  var parentChangeSet = {
997
- 'insert': {
998
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
999
- 'A': { 'String': { 'stringProperty': '' } },
1000
- 'B': { 'String': { 'stringProperty': '' } },
1001
- 'C': { 'String': { 'stringProperty': '' } },
1132
+ insert: {
1133
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1134
+ A: { String: { stringProperty: "" } },
1135
+ B: { String: { stringProperty: "" } },
1136
+ C: { String: { stringProperty: "" } },
1002
1137
  },
1003
1138
  },
1004
1139
  };
1005
1140
  var changeSet = new ChangeSet(originalChangeSet);
1006
1141
  changeSet._toReversibleChangeSet(parentChangeSet);
1007
1142
  expect(changeSet.getSerializedChangeSet()).to.eql({
1008
- 'insert': {
1009
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
1010
- 'F': { 'String': { 'stringProperty': '' } },
1143
+ insert: {
1144
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1145
+ F: { String: { stringProperty: "" } },
1011
1146
  },
1012
1147
  },
1013
- 'remove': {
1014
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
1015
- 'B': { 'String': { 'stringProperty': '' } },
1016
- 'C': { 'String': { 'stringProperty': '' } },
1148
+ remove: {
1149
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1150
+ B: { String: { stringProperty: "" } },
1151
+ C: { String: { stringProperty: "" } },
1017
1152
  },
1018
- }, 'modify': {
1019
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
1020
- 'A': {
1021
- 'String': {
1022
- 'stringProperty': {
1023
- 'value': 'hello',
1024
- 'oldValue': '',
1153
+ },
1154
+ modify: {
1155
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1156
+ A: {
1157
+ String: {
1158
+ stringProperty: {
1159
+ value: "hello",
1160
+ oldValue: "",
1025
1161
  },
1026
1162
  },
1027
1163
  },
@@ -1030,23 +1166,24 @@ describe('Reversible ChangeSets', function () {
1030
1166
  });
1031
1167
  changeSet.toInverseChangeSet();
1032
1168
  expect(changeSet.getSerializedChangeSet()).to.eql({
1033
- 'insert': {
1034
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
1035
- 'B': { 'String': { 'stringProperty': '' } },
1036
- 'C': { 'String': { 'stringProperty': '' } },
1169
+ insert: {
1170
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1171
+ B: { String: { stringProperty: "" } },
1172
+ C: { String: { stringProperty: "" } },
1037
1173
  },
1038
1174
  },
1039
- 'remove': {
1040
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
1041
- 'F': { 'String': { 'stringProperty': '' } },
1175
+ remove: {
1176
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1177
+ F: { String: { stringProperty: "" } },
1042
1178
  },
1043
- }, 'modify': {
1044
- 'autodesk.tests:AnonymousMapTestPropertyID-1.0.0': {
1045
- 'A': {
1046
- 'String': {
1047
- 'stringProperty': {
1048
- 'value': '',
1049
- 'oldValue': 'hello',
1179
+ },
1180
+ modify: {
1181
+ "autodesk.tests:AnonymousMapTestPropertyID-1.0.0": {
1182
+ A: {
1183
+ String: {
1184
+ stringProperty: {
1185
+ value: "",
1186
+ oldValue: "hello",
1050
1187
  },
1051
1188
  },
1052
1189
  },
@@ -1054,15 +1191,15 @@ describe('Reversible ChangeSets', function () {
1054
1191
  },
1055
1192
  });
1056
1193
  var originalChangeSet2 = {
1057
- 'insert': {
1058
- 'mysample:point2d-1.0.0': {
1059
- '7485af0e-c992-af6a-ef36-6a024eb4b4e5---2': {
1060
- 'String': {
1061
- 'guid': 'fb5f062f-9f56-55c3-f868-06caa5d8ce26',
1194
+ insert: {
1195
+ "mysample:point2d-1.0.0": {
1196
+ "7485af0e-c992-af6a-ef36-6a024eb4b4e5---2": {
1197
+ String: {
1198
+ guid: "fb5f062f-9f56-55c3-f868-06caa5d8ce26",
1062
1199
  },
1063
- 'Float64': {
1064
- 'x': 0,
1065
- 'y': 0,
1200
+ Float64: {
1201
+ x: 0,
1202
+ y: 0,
1066
1203
  },
1067
1204
  },
1068
1205
  },
@@ -1074,35 +1211,35 @@ describe('Reversible ChangeSets', function () {
1074
1211
  expect(changeSet2.getSerializedChangeSet()).to.eql(changeSet2.getSerializedChangeSet());
1075
1212
  changeSet2.toInverseChangeSet();
1076
1213
  expect(changeSet2.getSerializedChangeSet()).to.eql({
1077
- 'remove': {
1078
- 'mysample:point2d-1.0.0': {
1079
- '7485af0e-c992-af6a-ef36-6a024eb4b4e5---2': {
1080
- 'String': {
1081
- 'guid': 'fb5f062f-9f56-55c3-f868-06caa5d8ce26',
1214
+ remove: {
1215
+ "mysample:point2d-1.0.0": {
1216
+ "7485af0e-c992-af6a-ef36-6a024eb4b4e5---2": {
1217
+ String: {
1218
+ guid: "fb5f062f-9f56-55c3-f868-06caa5d8ce26",
1082
1219
  },
1083
- 'Float64': {
1084
- 'x': 0,
1085
- 'y': 0,
1220
+ Float64: {
1221
+ x: 0,
1222
+ y: 0,
1086
1223
  },
1087
1224
  },
1088
1225
  },
1089
1226
  },
1090
1227
  });
1091
1228
  });
1092
- it('should test reversible changeset for an array of non primitive types', function () {
1229
+ it("should test reversible changeset for an array of non primitive types", function () {
1093
1230
  var originalChangeSet = {
1094
- 'modify': {
1095
- 'array<mysample:point2d-1.0.0>': {
1096
- 'test2': {
1097
- 'modify': [
1231
+ modify: {
1232
+ "array<mysample:point2d-1.0.0>": {
1233
+ test2: {
1234
+ modify: [
1098
1235
  [
1099
1236
  0,
1100
1237
  [
1101
1238
  {
1102
- 'Float64': {
1103
- 'x': 15.104284463262685,
1239
+ Float64: {
1240
+ x: 15.104284463262685,
1104
1241
  },
1105
- 'typeid': 'mysample:point2d-1.0.0',
1242
+ typeid: "mysample:point2d-1.0.0",
1106
1243
  },
1107
1244
  ],
1108
1245
  ],
@@ -1112,63 +1249,63 @@ describe('Reversible ChangeSets', function () {
1112
1249
  },
1113
1250
  };
1114
1251
  var parentChangeSet = {
1115
- 'insert': {
1116
- 'mysample:point2d-1.0.0': {
1117
- 'test': {
1118
- 'String': {
1119
- 'guid': 'cd36cd32-0bd3-5c55-f94c-b95933fdc58b',
1252
+ insert: {
1253
+ "mysample:point2d-1.0.0": {
1254
+ test: {
1255
+ String: {
1256
+ guid: "cd36cd32-0bd3-5c55-f94c-b95933fdc58b",
1120
1257
  },
1121
- 'Float64': {
1122
- 'x': 65.18242364168808,
1123
- 'y': 0,
1258
+ Float64: {
1259
+ x: 65.18242364168808,
1260
+ y: 0,
1124
1261
  },
1125
1262
  },
1126
1263
  },
1127
- 'array<mysample:point2d-1.0.0>': {
1128
- 'test2': {
1129
- 'insert': [
1264
+ "array<mysample:point2d-1.0.0>": {
1265
+ test2: {
1266
+ insert: [
1130
1267
  [
1131
1268
  0,
1132
1269
  [
1133
1270
  {
1134
- 'String': {
1135
- 'guid': 'e66540ff-9e5e-d599-033e-d3dd55efc2a3',
1271
+ String: {
1272
+ guid: "e66540ff-9e5e-d599-033e-d3dd55efc2a3",
1136
1273
  },
1137
- 'Float64': {
1138
- 'x': 0,
1139
- 'y': 0,
1274
+ Float64: {
1275
+ x: 0,
1276
+ y: 0,
1140
1277
  },
1141
- 'typeid': 'mysample:point2d-1.0.0',
1278
+ typeid: "mysample:point2d-1.0.0",
1142
1279
  },
1143
1280
  {
1144
- 'String': {
1145
- 'guid': 'daeb5439-baef-7986-f90a-6a3a2f082250',
1281
+ String: {
1282
+ guid: "daeb5439-baef-7986-f90a-6a3a2f082250",
1146
1283
  },
1147
- 'Float64': {
1148
- 'x': 0,
1149
- 'y': 0,
1284
+ Float64: {
1285
+ x: 0,
1286
+ y: 0,
1150
1287
  },
1151
- 'typeid': 'mysample:point2d-1.0.0',
1288
+ typeid: "mysample:point2d-1.0.0",
1152
1289
  },
1153
1290
  ],
1154
1291
  ],
1155
1292
  ],
1156
1293
  },
1157
- 'test3': {},
1294
+ test3: {},
1158
1295
  },
1159
1296
  },
1160
- 'insertTemplates': {
1161
- 'mysample:point2d-1.0.0': {
1162
- 'typeid': 'mysample:point2d-1.0.0',
1163
- 'inherits': 'NamedProperty',
1164
- 'properties': [
1297
+ insertTemplates: {
1298
+ "mysample:point2d-1.0.0": {
1299
+ typeid: "mysample:point2d-1.0.0",
1300
+ inherits: "NamedProperty",
1301
+ properties: [
1165
1302
  {
1166
- 'id': 'x',
1167
- 'typeid': 'Float64',
1303
+ id: "x",
1304
+ typeid: "Float64",
1168
1305
  },
1169
1306
  {
1170
- 'id': 'y',
1171
- 'typeid': 'Float64',
1307
+ id: "y",
1308
+ typeid: "Float64",
1172
1309
  },
1173
1310
  ],
1174
1311
  },
@@ -1177,21 +1314,21 @@ describe('Reversible ChangeSets', function () {
1177
1314
  var changeSet = new ChangeSet(originalChangeSet);
1178
1315
  changeSet._toReversibleChangeSet(parentChangeSet);
1179
1316
  expect(changeSet.getSerializedChangeSet()).to.eql({
1180
- 'modify': {
1181
- 'array<mysample:point2d-1.0.0>': {
1182
- 'test2': {
1183
- 'modify': [
1317
+ modify: {
1318
+ "array<mysample:point2d-1.0.0>": {
1319
+ test2: {
1320
+ modify: [
1184
1321
  [
1185
1322
  0,
1186
1323
  [
1187
1324
  {
1188
- 'Float64': {
1189
- 'x': {
1325
+ Float64: {
1326
+ x: {
1190
1327
  value: 15.104284463262685,
1191
1328
  oldValue: 0,
1192
1329
  },
1193
1330
  },
1194
- 'typeid': 'mysample:point2d-1.0.0',
1331
+ typeid: "mysample:point2d-1.0.0",
1195
1332
  },
1196
1333
  ],
1197
1334
  ],
@@ -1202,21 +1339,21 @@ describe('Reversible ChangeSets', function () {
1202
1339
  });
1203
1340
  changeSet.toInverseChangeSet();
1204
1341
  expect(changeSet.getSerializedChangeSet()).to.eql({
1205
- 'modify': {
1206
- 'array<mysample:point2d-1.0.0>': {
1207
- 'test2': {
1208
- 'modify': [
1342
+ modify: {
1343
+ "array<mysample:point2d-1.0.0>": {
1344
+ test2: {
1345
+ modify: [
1209
1346
  [
1210
1347
  0,
1211
1348
  [
1212
1349
  {
1213
- 'Float64': {
1214
- 'x': {
1350
+ Float64: {
1351
+ x: {
1215
1352
  value: 0,
1216
1353
  oldValue: 15.104284463262685,
1217
1354
  },
1218
1355
  },
1219
- 'typeid': 'mysample:point2d-1.0.0',
1356
+ typeid: "mysample:point2d-1.0.0",
1220
1357
  },
1221
1358
  ],
1222
1359
  ],
@@ -1226,31 +1363,31 @@ describe('Reversible ChangeSets', function () {
1226
1363
  },
1227
1364
  });
1228
1365
  });
1229
- it('should correctly reverse inserts of strings', function () {
1366
+ it("should correctly reverse inserts of strings", function () {
1230
1367
  let CS = new ChangeSet({
1231
1368
  insert: {
1232
- 'String': {
1233
- 'test': 'xxx',
1369
+ String: {
1370
+ test: "xxx",
1234
1371
  },
1235
1372
  },
1236
1373
  });
1237
1374
  CS.toInverseChangeSet();
1238
1375
  expect(CS.getSerializedChangeSet()).to.deep.equal({
1239
- 'remove': {
1240
- 'String': {
1241
- 'test': 'xxx',
1376
+ remove: {
1377
+ String: {
1378
+ test: "xxx",
1242
1379
  },
1243
1380
  },
1244
1381
  });
1245
1382
  });
1246
- it('should correctly reverse inserts of literal strings within NodeProperties', function () {
1383
+ it("should correctly reverse inserts of literal strings within NodeProperties", function () {
1247
1384
  let CS = new ChangeSet({
1248
- 'modify': {
1249
- 'NodeProperty': {
1250
- 'test': {
1385
+ modify: {
1386
+ NodeProperty: {
1387
+ test: {
1251
1388
  insert: {
1252
- 'String': {
1253
- 'test': 'xxx',
1389
+ String: {
1390
+ test: "xxx",
1254
1391
  },
1255
1392
  },
1256
1393
  },
@@ -1259,12 +1396,12 @@ describe('Reversible ChangeSets', function () {
1259
1396
  });
1260
1397
  CS.toInverseChangeSet();
1261
1398
  expect(CS.getSerializedChangeSet()).to.deep.equal({
1262
- 'modify': {
1263
- 'NodeProperty': {
1264
- 'test': {
1265
- 'remove': {
1266
- 'String': {
1267
- 'test': 'xxx',
1399
+ modify: {
1400
+ NodeProperty: {
1401
+ test: {
1402
+ remove: {
1403
+ String: {
1404
+ test: "xxx",
1268
1405
  },
1269
1406
  },
1270
1407
  },
@@ -1272,39 +1409,45 @@ describe('Reversible ChangeSets', function () {
1272
1409
  },
1273
1410
  });
1274
1411
  });
1275
- it('@regression should not fail when building reversible change sets', function () {
1276
- var parentChangeSet = require('./validation/reversibleChangeSetTestData.js').parentChangeSet;
1277
- var originalChangeSet = require('./validation/reversibleChangeSetTestData.js').originalChangeSet;
1412
+ it("@regression should not fail when building reversible change sets", function () {
1413
+ var parentChangeSet = require("./validation/reversibleChangeSetTestData.js").parentChangeSet;
1414
+ var originalChangeSet = require("./validation/reversibleChangeSetTestData.js").originalChangeSet;
1278
1415
  var changeSet = new ChangeSet(originalChangeSet);
1279
1416
  changeSet._toReversibleChangeSet(parentChangeSet);
1280
1417
  });
1281
- it('@regression should not fail when creating a reversible change set', function () {
1418
+ it("@regression should not fail when creating a reversible change set", function () {
1282
1419
  var cs = {
1283
- 'modify': {
1284
- 'autodesk.compute:graph-1.0.0': {
1285
- '5eb6ebe1-92c8-52fa-984b-b0b65c46d2a7': {
1286
- 'map<autodesk.compute:node-2.0.0>': {
1287
- 'computeNodes': {
1288
- 'modify': {
1289
- 'autodesk.compute:fanOut-1.0.0': {
1290
- 'a7e7d213-1202-9ee4-a3c1-8a33d6f36122': {
1291
- 'autodesk.compute:context-1.0.0': {
1292
- 'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '/8ce10fdd-b2b6-7152-21dc-c0e199b579e3' } },
1420
+ modify: {
1421
+ "autodesk.compute:graph-1.0.0": {
1422
+ "5eb6ebe1-92c8-52fa-984b-b0b65c46d2a7": {
1423
+ "map<autodesk.compute:node-2.0.0>": {
1424
+ computeNodes: {
1425
+ modify: {
1426
+ "autodesk.compute:fanOut-1.0.0": {
1427
+ "a7e7d213-1202-9ee4-a3c1-8a33d6f36122": {
1428
+ "autodesk.compute:context-1.0.0": {
1429
+ computeContext: {
1430
+ "Reference<autodesk.compute:resource-2.0.0>": {
1431
+ resource: "/8ce10fdd-b2b6-7152-21dc-c0e199b579e3",
1432
+ },
1433
+ },
1293
1434
  },
1294
- 'map<autodesk.compute:node-2.0.0>': {
1295
- 'computeNodes': {
1296
- 'modify': {
1297
- 'autodesk.test:testCN-1.0.0': {
1298
- '1e924300-92ef-eaad-391f-53b77fe01099': {
1299
- 'enum<Enum>': { 'status': 1 }, 'autodesk.compute:context-1.0.0': {
1300
- 'computeContext': {
1301
- 'Reference<autodesk.compute:resource-2.0.0>': {
1302
- 'resource': '/c1a811ea-608e-5fcc-1487-c74ab6939dee',
1435
+ "map<autodesk.compute:node-2.0.0>": {
1436
+ computeNodes: {
1437
+ modify: {
1438
+ "autodesk.test:testCN-1.0.0": {
1439
+ "1e924300-92ef-eaad-391f-53b77fe01099": {
1440
+ "enum<Enum>": { status: 1 },
1441
+ "autodesk.compute:context-1.0.0": {
1442
+ computeContext: {
1443
+ "Reference<autodesk.compute:resource-2.0.0>": {
1444
+ resource: "/c1a811ea-608e-5fcc-1487-c74ab6939dee",
1303
1445
  },
1304
1446
  },
1305
- }, 'Reference<autodesk.core:user-1.0.0>': {
1306
- 'inputs.input': '/5eb6ebe1-92c8-52fa-984b-b0b65c46d2a7.computeNodes[a7e7d213-1202-9ee4-a3c1-8a33d6f36122]' +
1307
- '.intermediateProperties[2c06da5c-8614-e9c2-3bd6-75ae739eba4f]',
1447
+ },
1448
+ "Reference<autodesk.core:user-1.0.0>": {
1449
+ "inputs.input": "/5eb6ebe1-92c8-52fa-984b-b0b65c46d2a7.computeNodes[a7e7d213-1202-9ee4-a3c1-8a33d6f36122]" +
1450
+ ".intermediateProperties[2c06da5c-8614-e9c2-3bd6-75ae739eba4f]",
1308
1451
  },
1309
1452
  },
1310
1453
  },
@@ -1321,24 +1464,35 @@ describe('Reversible ChangeSets', function () {
1321
1464
  },
1322
1465
  };
1323
1466
  var parent = {
1324
- 'insert': {
1325
- 'autodesk.compute:graph-1.0.0': {
1326
- '5eb6ebe1-92c8-52fa-984b-b0b65c46d2a7': {
1327
- 'map<autodesk.compute:node-2.0.0>': {
1328
- 'computeNodes': {
1329
- 'insert': {
1330
- 'autodesk.compute:fanOut-1.0.0': {
1331
- 'a7e7d213-1202-9ee4-a3c1-8a33d6f36122': {
1332
- 'autodesk.compute:context-1.0.0': {
1333
- 'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '' } },
1334
- }, 'map<autodesk.compute:node-2.0.0>': {
1335
- 'computeNodes': {
1336
- 'insert': {
1337
- 'autodesk.test:testCN-1.0.0': {
1338
- '1e924300-92ef-eaad-391f-53b77fe01099': {
1339
- 'enum<Enum>': { 'status': 0 }, 'autodesk.compute:context-1.0.0': {
1340
- 'computeContext': { 'Reference<autodesk.compute:resource-2.0.0>': { 'resource': '' } },
1341
- }, 'Reference<autodesk.core:user-1.0.0>': { 'inputs.input': '' },
1467
+ insert: {
1468
+ "autodesk.compute:graph-1.0.0": {
1469
+ "5eb6ebe1-92c8-52fa-984b-b0b65c46d2a7": {
1470
+ "map<autodesk.compute:node-2.0.0>": {
1471
+ computeNodes: {
1472
+ insert: {
1473
+ "autodesk.compute:fanOut-1.0.0": {
1474
+ "a7e7d213-1202-9ee4-a3c1-8a33d6f36122": {
1475
+ "autodesk.compute:context-1.0.0": {
1476
+ computeContext: {
1477
+ "Reference<autodesk.compute:resource-2.0.0>": {
1478
+ resource: "",
1479
+ },
1480
+ },
1481
+ },
1482
+ "map<autodesk.compute:node-2.0.0>": {
1483
+ computeNodes: {
1484
+ insert: {
1485
+ "autodesk.test:testCN-1.0.0": {
1486
+ "1e924300-92ef-eaad-391f-53b77fe01099": {
1487
+ "enum<Enum>": { status: 0 },
1488
+ "autodesk.compute:context-1.0.0": {
1489
+ computeContext: {
1490
+ "Reference<autodesk.compute:resource-2.0.0>": {
1491
+ resource: "",
1492
+ },
1493
+ },
1494
+ },
1495
+ "Reference<autodesk.core:user-1.0.0>": { "inputs.input": "" },
1342
1496
  },
1343
1497
  },
1344
1498
  },