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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +1 -0
  2. package/dist/containerSerializer.d.ts.map +1 -1
  3. package/dist/containerSerializer.js +5 -5
  4. package/dist/containerSerializer.js.map +1 -1
  5. package/dist/enableValidations.js.map +1 -1
  6. package/dist/index.d.ts +19 -19
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
  10. package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  11. package/dist/properties/abstractStaticCollectionProperty.js +70 -53
  12. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  13. package/dist/properties/arrayProperty.d.ts.map +1 -1
  14. package/dist/properties/arrayProperty.js +152 -103
  15. package/dist/properties/arrayProperty.js.map +1 -1
  16. package/dist/properties/baseProperty.d.ts +4 -4
  17. package/dist/properties/baseProperty.d.ts.map +1 -1
  18. package/dist/properties/baseProperty.js +69 -47
  19. package/dist/properties/baseProperty.js.map +1 -1
  20. package/dist/properties/boolProperty.d.ts.map +1 -1
  21. package/dist/properties/boolProperty.js +3 -3
  22. package/dist/properties/boolProperty.js.map +1 -1
  23. package/dist/properties/containerProperty.d.ts +8 -8
  24. package/dist/properties/containerProperty.d.ts.map +1 -1
  25. package/dist/properties/containerProperty.js +33 -26
  26. package/dist/properties/containerProperty.js.map +1 -1
  27. package/dist/properties/enumArrayProperty.d.ts.map +1 -1
  28. package/dist/properties/enumArrayProperty.js +14 -14
  29. package/dist/properties/enumArrayProperty.js.map +1 -1
  30. package/dist/properties/enumProperty.d.ts.map +1 -1
  31. package/dist/properties/enumProperty.js +17 -17
  32. package/dist/properties/enumProperty.js.map +1 -1
  33. package/dist/properties/floatProperties.js +4 -4
  34. package/dist/properties/floatProperties.js.map +1 -1
  35. package/dist/properties/index.d.ts +23 -23
  36. package/dist/properties/index.d.ts.map +1 -1
  37. package/dist/properties/index.js.map +1 -1
  38. package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  39. package/dist/properties/indexedCollectionBaseProperty.js +47 -37
  40. package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
  41. package/dist/properties/intProperties.d.ts.map +1 -1
  42. package/dist/properties/intProperties.js +10 -10
  43. package/dist/properties/intProperties.js.map +1 -1
  44. package/dist/properties/lazyLoadedProperties.js.map +1 -1
  45. package/dist/properties/mapProperty.d.ts.map +1 -1
  46. package/dist/properties/mapProperty.js +21 -17
  47. package/dist/properties/mapProperty.js.map +1 -1
  48. package/dist/properties/namedNodeProperty.d.ts.map +1 -1
  49. package/dist/properties/namedNodeProperty.js +3 -3
  50. package/dist/properties/namedNodeProperty.js.map +1 -1
  51. package/dist/properties/namedProperty.d.ts.map +1 -1
  52. package/dist/properties/namedProperty.js +7 -5
  53. package/dist/properties/namedProperty.js.map +1 -1
  54. package/dist/properties/nodeProperty.d.ts.map +1 -1
  55. package/dist/properties/nodeProperty.js +5 -3
  56. package/dist/properties/nodeProperty.js.map +1 -1
  57. package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
  58. package/dist/properties/primitiveTypeCasts.js +9 -9
  59. package/dist/properties/primitiveTypeCasts.js.map +1 -1
  60. package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
  61. package/dist/properties/referenceArrayProperty.js +31 -25
  62. package/dist/properties/referenceArrayProperty.js.map +1 -1
  63. package/dist/properties/referenceMapProperty.d.ts.map +1 -1
  64. package/dist/properties/referenceMapProperty.js +18 -18
  65. package/dist/properties/referenceMapProperty.js.map +1 -1
  66. package/dist/properties/referenceProperty.d.ts.map +1 -1
  67. package/dist/properties/referenceProperty.js +33 -29
  68. package/dist/properties/referenceProperty.js.map +1 -1
  69. package/dist/properties/setProperty.d.ts.map +1 -1
  70. package/dist/properties/setProperty.js +31 -29
  71. package/dist/properties/setProperty.js.map +1 -1
  72. package/dist/properties/stringProperty.d.ts.map +1 -1
  73. package/dist/properties/stringProperty.js +56 -40
  74. package/dist/properties/stringProperty.js.map +1 -1
  75. package/dist/properties/uintProperties.js +5 -5
  76. package/dist/properties/uintProperties.js.map +1 -1
  77. package/dist/properties/valueArrayProperty.d.ts +1 -1
  78. package/dist/properties/valueArrayProperty.d.ts.map +1 -1
  79. package/dist/properties/valueArrayProperty.js +30 -29
  80. package/dist/properties/valueArrayProperty.js.map +1 -1
  81. package/dist/properties/valueMapProperty.d.ts.map +1 -1
  82. package/dist/properties/valueMapProperty.js +31 -29
  83. package/dist/properties/valueMapProperty.js.map +1 -1
  84. package/dist/properties/valueProperty.d.ts.map +1 -1
  85. package/dist/properties/valueProperty.js +11 -9
  86. package/dist/properties/valueProperty.js.map +1 -1
  87. package/dist/propertyFactory.d.ts.map +1 -1
  88. package/dist/propertyFactory.js +309 -252
  89. package/dist/propertyFactory.js.map +1 -1
  90. package/dist/propertyTemplate.d.ts +17 -17
  91. package/dist/propertyTemplate.d.ts.map +1 -1
  92. package/dist/propertyTemplate.js +64 -45
  93. package/dist/propertyTemplate.js.map +1 -1
  94. package/dist/propertyTemplateWrapper.d.ts.map +1 -1
  95. package/dist/propertyTemplateWrapper.js +40 -25
  96. package/dist/propertyTemplateWrapper.js.map +1 -1
  97. package/dist/propertyUtils.d.ts.map +1 -1
  98. package/dist/propertyUtils.js.map +1 -1
  99. package/dist/test/properties/arrayProperty.spec.js +566 -490
  100. package/dist/test/properties/arrayProperty.spec.js.map +1 -1
  101. package/dist/test/properties/baseProperty.spec.js +293 -280
  102. package/dist/test/properties/baseProperty.spec.js.map +1 -1
  103. package/dist/test/properties/containerProperty.spec.js +100 -94
  104. package/dist/test/properties/containerProperty.spec.js.map +1 -1
  105. package/dist/test/properties/customArrayProperty.spec.js +174 -147
  106. package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
  107. package/dist/test/properties/enumArrayProperty.spec.js +67 -63
  108. package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
  109. package/dist/test/properties/enumProperty.spec.js +115 -97
  110. package/dist/test/properties/enumProperty.spec.js.map +1 -1
  111. package/dist/test/properties/float32.spec.js +5 -5
  112. package/dist/test/properties/float32.spec.js.map +1 -1
  113. package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
  114. package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
  115. package/dist/test/properties/int64MapProperty.spec.js +185 -166
  116. package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
  117. package/dist/test/properties/int64Property.spec.js +109 -109
  118. package/dist/test/properties/int64Property.spec.js.map +1 -1
  119. package/dist/test/properties/isLeafNode.spec.js +75 -76
  120. package/dist/test/properties/isLeafNode.spec.js.map +1 -1
  121. package/dist/test/properties/mapProperty.spec.js +571 -531
  122. package/dist/test/properties/mapProperty.spec.js.map +1 -1
  123. package/dist/test/properties/namedNodeProperty.spec.js +31 -31
  124. package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
  125. package/dist/test/properties/nodeProperty.spec.js +805 -795
  126. package/dist/test/properties/nodeProperty.spec.js.map +1 -1
  127. package/dist/test/properties/referenceProperty.spec.js +729 -679
  128. package/dist/test/properties/referenceProperty.spec.js.map +1 -1
  129. package/dist/test/properties/relationshipProperty.spec.js +16 -16
  130. package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
  131. package/dist/test/properties/setProperty.spec.js +288 -227
  132. package/dist/test/properties/setProperty.spec.js.map +1 -1
  133. package/dist/test/properties/stringProperty.spec.js +326 -318
  134. package/dist/test/properties/stringProperty.spec.js.map +1 -1
  135. package/dist/test/properties/uint64Property.spec.js +46 -36
  136. package/dist/test/properties/uint64Property.spec.js.map +1 -1
  137. package/dist/test/properties/valueMapProperty.spec.js +259 -246
  138. package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
  139. package/dist/test/properties/valueProperty.spec.js +49 -43
  140. package/dist/test/properties/valueProperty.spec.js.map +1 -1
  141. package/dist/test/propertyFactory.spec.js +2038 -1631
  142. package/dist/test/propertyFactory.spec.js.map +1 -1
  143. package/dist/test/propertyTemplateWrapper.spec.js +72 -102
  144. package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
  145. package/dist/test/propertyUtils.spec.js +22 -21
  146. package/dist/test/propertyUtils.spec.js.map +1 -1
  147. package/dist/test/reversibleChangeset.spec.js +857 -703
  148. package/dist/test/reversibleChangeset.spec.js.map +1 -1
  149. package/dist/test/setup.js +5 -5
  150. package/dist/test/setup.js.map +1 -1
  151. package/dist/test/tsconfig.tsbuildinfo +1 -1
  152. package/dist/test/utils.spec.js +1334 -1144
  153. package/dist/test/utils.spec.js.map +1 -1
  154. package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
  155. package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
  156. package/dist/test/validation/badPrimitiveTypeid.js +12 -12
  157. package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
  158. package/dist/test/validation/goodColorId.js +91 -91
  159. package/dist/test/validation/goodColorId.js.map +1 -1
  160. package/dist/test/validation/goodColorPalette.js +4 -4
  161. package/dist/test/validation/goodColorPalette.js.map +1 -1
  162. package/dist/test/validation/goodPointId.js +20 -20
  163. package/dist/test/validation/goodPointId.js.map +1 -1
  164. package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
  165. package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
  166. package/lib/containerSerializer.d.ts.map +1 -1
  167. package/lib/containerSerializer.js +5 -5
  168. package/lib/containerSerializer.js.map +1 -1
  169. package/lib/enableValidations.js.map +1 -1
  170. package/lib/index.d.ts +19 -19
  171. package/lib/index.d.ts.map +1 -1
  172. package/lib/index.js +19 -19
  173. package/lib/index.js.map +1 -1
  174. package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
  175. package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  176. package/lib/properties/abstractStaticCollectionProperty.js +70 -53
  177. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  178. package/lib/properties/arrayProperty.d.ts.map +1 -1
  179. package/lib/properties/arrayProperty.js +152 -103
  180. package/lib/properties/arrayProperty.js.map +1 -1
  181. package/lib/properties/baseProperty.d.ts +4 -4
  182. package/lib/properties/baseProperty.d.ts.map +1 -1
  183. package/lib/properties/baseProperty.js +73 -51
  184. package/lib/properties/baseProperty.js.map +1 -1
  185. package/lib/properties/boolProperty.d.ts.map +1 -1
  186. package/lib/properties/boolProperty.js +3 -3
  187. package/lib/properties/boolProperty.js.map +1 -1
  188. package/lib/properties/containerProperty.d.ts +8 -8
  189. package/lib/properties/containerProperty.d.ts.map +1 -1
  190. package/lib/properties/containerProperty.js +33 -26
  191. package/lib/properties/containerProperty.js.map +1 -1
  192. package/lib/properties/enumArrayProperty.d.ts.map +1 -1
  193. package/lib/properties/enumArrayProperty.js +14 -14
  194. package/lib/properties/enumArrayProperty.js.map +1 -1
  195. package/lib/properties/enumProperty.d.ts.map +1 -1
  196. package/lib/properties/enumProperty.js +17 -17
  197. package/lib/properties/enumProperty.js.map +1 -1
  198. package/lib/properties/floatProperties.js +4 -4
  199. package/lib/properties/floatProperties.js.map +1 -1
  200. package/lib/properties/index.d.ts +23 -23
  201. package/lib/properties/index.d.ts.map +1 -1
  202. package/lib/properties/index.js +23 -23
  203. package/lib/properties/index.js.map +1 -1
  204. package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  205. package/lib/properties/indexedCollectionBaseProperty.js +47 -37
  206. package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
  207. package/lib/properties/intProperties.d.ts.map +1 -1
  208. package/lib/properties/intProperties.js +10 -10
  209. package/lib/properties/intProperties.js.map +1 -1
  210. package/lib/properties/lazyLoadedProperties.js.map +1 -1
  211. package/lib/properties/mapProperty.d.ts.map +1 -1
  212. package/lib/properties/mapProperty.js +21 -17
  213. package/lib/properties/mapProperty.js.map +1 -1
  214. package/lib/properties/namedNodeProperty.d.ts.map +1 -1
  215. package/lib/properties/namedNodeProperty.js +3 -3
  216. package/lib/properties/namedNodeProperty.js.map +1 -1
  217. package/lib/properties/namedProperty.d.ts.map +1 -1
  218. package/lib/properties/namedProperty.js +7 -5
  219. package/lib/properties/namedProperty.js.map +1 -1
  220. package/lib/properties/nodeProperty.d.ts.map +1 -1
  221. package/lib/properties/nodeProperty.js +5 -3
  222. package/lib/properties/nodeProperty.js.map +1 -1
  223. package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
  224. package/lib/properties/primitiveTypeCasts.js +9 -9
  225. package/lib/properties/primitiveTypeCasts.js.map +1 -1
  226. package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
  227. package/lib/properties/referenceArrayProperty.js +31 -25
  228. package/lib/properties/referenceArrayProperty.js.map +1 -1
  229. package/lib/properties/referenceMapProperty.d.ts.map +1 -1
  230. package/lib/properties/referenceMapProperty.js +18 -18
  231. package/lib/properties/referenceMapProperty.js.map +1 -1
  232. package/lib/properties/referenceProperty.d.ts.map +1 -1
  233. package/lib/properties/referenceProperty.js +33 -29
  234. package/lib/properties/referenceProperty.js.map +1 -1
  235. package/lib/properties/setProperty.d.ts.map +1 -1
  236. package/lib/properties/setProperty.js +31 -29
  237. package/lib/properties/setProperty.js.map +1 -1
  238. package/lib/properties/stringProperty.d.ts.map +1 -1
  239. package/lib/properties/stringProperty.js +56 -40
  240. package/lib/properties/stringProperty.js.map +1 -1
  241. package/lib/properties/uintProperties.js +5 -5
  242. package/lib/properties/uintProperties.js.map +1 -1
  243. package/lib/properties/valueArrayProperty.d.ts +1 -1
  244. package/lib/properties/valueArrayProperty.d.ts.map +1 -1
  245. package/lib/properties/valueArrayProperty.js +30 -29
  246. package/lib/properties/valueArrayProperty.js.map +1 -1
  247. package/lib/properties/valueMapProperty.d.ts.map +1 -1
  248. package/lib/properties/valueMapProperty.js +31 -29
  249. package/lib/properties/valueMapProperty.js.map +1 -1
  250. package/lib/properties/valueProperty.d.ts.map +1 -1
  251. package/lib/properties/valueProperty.js +11 -9
  252. package/lib/properties/valueProperty.js.map +1 -1
  253. package/lib/propertyFactory.d.ts.map +1 -1
  254. package/lib/propertyFactory.js +309 -252
  255. package/lib/propertyFactory.js.map +1 -1
  256. package/lib/propertyTemplate.d.ts +17 -17
  257. package/lib/propertyTemplate.d.ts.map +1 -1
  258. package/lib/propertyTemplate.js +64 -45
  259. package/lib/propertyTemplate.js.map +1 -1
  260. package/lib/propertyTemplateWrapper.d.ts.map +1 -1
  261. package/lib/propertyTemplateWrapper.js +40 -25
  262. package/lib/propertyTemplateWrapper.js.map +1 -1
  263. package/lib/propertyUtils.d.ts.map +1 -1
  264. package/lib/propertyUtils.js.map +1 -1
  265. package/package.json +28 -28
  266. package/src/index.d.ts +2750 -2681
@@ -5,26 +5,24 @@
5
5
  /**
6
6
  * @fileoverview In this file, we will test the Int64ArrayProperty object described in /src/properties/arrayProperty.js
7
7
  */
8
- describe('Int64ArrayProperty', function () {
8
+ describe("Int64ArrayProperty", function () {
9
9
  var PropertyFactory, BaseProperty, ChangeSet, MSG;
10
10
  var changeSetWithEntries, removalChangeSet;
11
11
  var myInt64Prop, Int64;
12
12
  before(function () {
13
13
  // Get all the objects we need in this test here.
14
- PropertyFactory = require('../..').PropertyFactory;
15
- BaseProperty = require('../..').BaseProperty;
16
- ChangeSet = require('@fluid-experimental/property-changeset').ChangeSet;
17
- Int64 = require('@fluid-experimental/property-common').Int64;
18
- MSG = require('@fluid-experimental/property-common').constants.MSG;
14
+ PropertyFactory = require("../..").PropertyFactory;
15
+ BaseProperty = require("../..").BaseProperty;
16
+ ChangeSet = require("@fluid-experimental/property-changeset").ChangeSet;
17
+ Int64 = require("@fluid-experimental/property-common").Int64;
18
+ MSG = require("@fluid-experimental/property-common").constants.MSG;
19
19
  // Register a template with a set property for the tests
20
20
  var SimpleInt64TestPropertyTemplate = {
21
- typeid: 'autodesk.tests:SimpleInt64TestProperty-1.0.0',
22
- properties: [
23
- { id: 'int64Property', typeid: 'Int64', context: 'array' },
24
- ],
21
+ typeid: "autodesk.tests:SimpleInt64TestProperty-1.0.0",
22
+ properties: [{ id: "int64Property", typeid: "Int64", context: "array" }],
25
23
  };
26
24
  PropertyFactory._reregister(SimpleInt64TestPropertyTemplate);
27
- myInt64Prop = PropertyFactory.create('Int64', 'array');
25
+ myInt64Prop = PropertyFactory.create("Int64", "array");
28
26
  });
29
27
  // Inserts an Int64 value into the array
30
28
  var insertInt64Value = function (int64Prop) {
@@ -38,91 +36,148 @@ describe('Int64ArrayProperty', function () {
38
36
  var modifyInt64Value = function (int64Prop) {
39
37
  int64Prop.setRange(0, [new Int64(0, 2)]);
40
38
  };
41
- describe('Testing creation, assignment and serialization', function () {
42
- it('should be empty at the beginning', function () {
39
+ describe("Testing creation, assignment and serialization", function () {
40
+ it("should be empty at the beginning", function () {
43
41
  expect(myInt64Prop.length).to.equal(0);
44
- expect(myInt64Prop.serialize({ 'dirtyOnly': true })).to.be.empty;
45
- expect(myInt64Prop.serialize({ 'dirtyOnly': false })).to.be.empty;
42
+ expect(myInt64Prop.serialize({ dirtyOnly: true })).to.be.empty;
43
+ expect(myInt64Prop.serialize({ dirtyOnly: false })).to.be.empty;
46
44
  });
47
- it('should be possible to insert into the 64 bit array', function () {
45
+ it("should be possible to insert into the 64 bit array", function () {
48
46
  // Text insertion
49
- myInt64Prop.insertRange(0, [new Int64(1, 2), '12345678987654321']);
47
+ myInt64Prop.insertRange(0, [new Int64(1, 2), "12345678987654321"]);
50
48
  expect(myInt64Prop.get(0)).to.deep.equal(new Int64(1, 2));
51
49
  myInt64Prop.insertRange(2, [5]);
52
50
  expect(myInt64Prop.get(1)).to.deep.equal(new Int64(1653732529, 2874452));
53
- changeSetWithEntries = myInt64Prop.serialize({ 'dirtyOnly': true });
54
- expect(myInt64Prop.serialize({ 'dirtyOnly': false })).to.deep.equal({ insert: [[0, [[1, 2], [1653732529, 2874452], [5, 0]]]] });
55
- expect(myInt64Prop.serialize({ 'dirtyOnly': true })).to.deep.equal({ insert: [[0, [[1, 2], [1653732529, 2874452], [5, 0]]]] });
51
+ changeSetWithEntries = myInt64Prop.serialize({ dirtyOnly: true });
52
+ expect(myInt64Prop.serialize({ dirtyOnly: false })).to.deep.equal({
53
+ insert: [
54
+ [
55
+ 0,
56
+ [
57
+ [1, 2],
58
+ [1653732529, 2874452],
59
+ [5, 0],
60
+ ],
61
+ ],
62
+ ],
63
+ });
64
+ expect(myInt64Prop.serialize({ dirtyOnly: true })).to.deep.equal({
65
+ insert: [
66
+ [
67
+ 0,
68
+ [
69
+ [1, 2],
70
+ [1653732529, 2874452],
71
+ [5, 0],
72
+ ],
73
+ ],
74
+ ],
75
+ });
56
76
  });
57
- it('should be possible to set values in the 64 bit array', function () {
58
- myInt64Prop.setRange(0, [1, '123', new Int64(2, 2)]);
77
+ it("should be possible to set values in the 64 bit array", function () {
78
+ myInt64Prop.setRange(0, [1, "123", new Int64(2, 2)]);
59
79
  expect(myInt64Prop.get(0)).to.deep.equal(new Int64(1, 0));
60
80
  myInt64Prop.setRange(2, [new Int64(4, 5)]);
61
- changeSetWithEntries = myInt64Prop.serialize({ 'dirtyOnly': true });
62
- expect(myInt64Prop.serialize({ 'dirtyOnly': false })).to.deep.equal({ insert: [[0, [[1, 0], [123, 0], [4, 5]]]] });
63
- expect(myInt64Prop.serialize({ 'dirtyOnly': true })).to.deep.equal({ insert: [[0, [[1, 0], [123, 0], [4, 5]]]] });
81
+ changeSetWithEntries = myInt64Prop.serialize({ dirtyOnly: true });
82
+ expect(myInt64Prop.serialize({ dirtyOnly: false })).to.deep.equal({
83
+ insert: [
84
+ [
85
+ 0,
86
+ [
87
+ [1, 0],
88
+ [123, 0],
89
+ [4, 5],
90
+ ],
91
+ ],
92
+ ],
93
+ });
94
+ expect(myInt64Prop.serialize({ dirtyOnly: true })).to.deep.equal({
95
+ insert: [
96
+ [
97
+ 0,
98
+ [
99
+ [1, 0],
100
+ [123, 0],
101
+ [4, 5],
102
+ ],
103
+ ],
104
+ ],
105
+ });
64
106
  });
65
- it('.setRange should throw an error when in_offset is not an integer', function () {
66
- expect(() => { myInt64Prop.setRange('test', [new Int64(2, 2)]); })
67
- .to.throw(MSG.NOT_NUMBER);
107
+ it(".setRange should throw an error when in_offset is not an integer", function () {
108
+ expect(() => {
109
+ myInt64Prop.setRange("test", [new Int64(2, 2)]);
110
+ }).to.throw(MSG.NOT_NUMBER);
68
111
  });
69
- it('.setRange should throw an error when in_array is not an array', function () {
70
- expect(() => { myInt64Prop.setRange(0, new Int64(2, 2)); })
71
- .to.throw(MSG.IN_ARRAY_NOT_ARRAY + 'Int64ArrayProperty.setRange');
112
+ it(".setRange should throw an error when in_array is not an array", function () {
113
+ expect(() => {
114
+ myInt64Prop.setRange(0, new Int64(2, 2));
115
+ }).to.throw(MSG.IN_ARRAY_NOT_ARRAY + "Int64ArrayProperty.setRange");
72
116
  });
73
- it('Should handle removals correctly', function () {
117
+ it("Should handle removals correctly", function () {
74
118
  myInt64Prop.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);
75
119
  myInt64Prop.removeRange(0, 2);
76
120
  expect(myInt64Prop.get(0)).to.deep.equal(new Int64(4, 5));
77
121
  removalChangeSet = myInt64Prop.serialize({
78
- 'dirtyOnly': true,
79
- 'includeRootTypeid': false,
80
- 'dirtinessType': BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
122
+ dirtyOnly: true,
123
+ includeRootTypeid: false,
124
+ dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
81
125
  });
82
- expect(removalChangeSet).to.have.all.keys(['remove']);
126
+ expect(removalChangeSet).to.have.all.keys(["remove"]);
83
127
  expect(removalChangeSet.remove).to.have.length(1);
84
128
  expect(removalChangeSet.remove[0]).to.deep.equal([0, 2]);
85
129
  });
86
- it('Should support deserialization', function () {
87
- var deserializedNode = PropertyFactory.create('Int64', 'array');
130
+ it("Should support deserialization", function () {
131
+ var deserializedNode = PropertyFactory.create("Int64", "array");
88
132
  var deserializedChanges1 = deserializedNode.deserialize(changeSetWithEntries);
89
133
  expect(deserializedChanges1).to.deep.equal(changeSetWithEntries);
90
134
  var deserializedChanges3 = deserializedNode.deserialize({});
91
135
  expect(deserializedChanges3).to.deep.equal({ remove: [[0, 3]] });
92
136
  });
93
- it('inserting at a bad position should throw an exception', function () {
137
+ it("inserting at a bad position should throw an exception", function () {
94
138
  expect(function () {
95
139
  myInt64Prop.insertRange(2242, new Int64(4, 5));
96
140
  }).to.throw();
97
141
  });
98
- it('Should support applying changeset', function () {
99
- var node = PropertyFactory.create('Int64', 'array');
142
+ it("Should support applying changeset", function () {
143
+ var node = PropertyFactory.create("Int64", "array");
100
144
  node._applyChangeset(changeSetWithEntries);
101
145
  expect(node.get(0)).to.deep.equal(new Int64(1));
102
- expect(node.serialize()).to.deep.equal({ insert: [[0, [[1, 0], [123, 0], [4, 5]]]] });
146
+ expect(node.serialize()).to.deep.equal({
147
+ insert: [
148
+ [
149
+ 0,
150
+ [
151
+ [1, 0],
152
+ [123, 0],
153
+ [4, 5],
154
+ ],
155
+ ],
156
+ ],
157
+ });
103
158
  });
104
159
  });
105
- describe('change set specification should be met', function () {
106
- it('Should handle push correctly', function () {
107
- var t = PropertyFactory.create('Int64', 'array');
160
+ describe("change set specification should be met", function () {
161
+ it("Should handle push correctly", function () {
162
+ var t = PropertyFactory.create("Int64", "array");
108
163
  t.insertRange(0, [new Int64(1, 2), new Int64(3, 4)]);
109
164
  t.cleanDirty();
110
165
  t.push(new Int64(4, 5));
111
- expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal({
112
- 'insert': [[2, [[4, 5]]]],
166
+ expect(t.serialize({ dirtyOnly: true })).to.deep.equal({
167
+ insert: [[2, [[4, 5]]]],
113
168
  });
114
169
  });
115
- it('Should handle modifies correctly', function () {
116
- var t = PropertyFactory.create('Int64', 'array');
170
+ it("Should handle modifies correctly", function () {
171
+ var t = PropertyFactory.create("Int64", "array");
117
172
  t.insertRange(0, [new Int64(1, 2), new Int64(3, 4)]);
118
173
  t.cleanDirty();
119
174
  t.set(1, new Int64(4, 5));
120
- expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal({
121
- 'modify': [[1, [[4, 5]]]],
175
+ expect(t.serialize({ dirtyOnly: true })).to.deep.equal({
176
+ modify: [[1, [[4, 5]]]],
122
177
  });
123
178
  });
124
179
  });
125
- describe('squashing', function () {
180
+ describe("squashing", function () {
126
181
  // Helper function to test the squashing for different containers
127
182
  var innerTestChangeSetSquashing = function (io_testProperty, io_int64Property, io_initialChangeset, in_options, in_collection) {
128
183
  var squashedChangeset = new ChangeSet();
@@ -132,7 +187,7 @@ describe('Int64ArrayProperty', function () {
132
187
  var callbacks = in_options.callbacks;
133
188
  for (var i = 0; i < callbacks.length; i++) {
134
189
  callbacks[i](io_int64Property);
135
- var changes = io_testProperty.serialize({ 'dirtyOnly': true });
190
+ var changes = io_testProperty.serialize({ dirtyOnly: true });
136
191
  io_testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
137
192
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
138
193
  squashedChangeset.applyChangeSet(changes);
@@ -155,40 +210,47 @@ describe('Int64ArrayProperty', function () {
155
210
  // be given as first parameter
156
211
  //
157
212
  var testChangeSetSquashing = function (in_options) {
158
- var testProperty = PropertyFactory.create('autodesk.tests:SimpleInt64TestProperty-1.0.0');
213
+ var testProperty = PropertyFactory.create("autodesk.tests:SimpleInt64TestProperty-1.0.0");
159
214
  if (in_options.pre) {
160
215
  in_options.pre(testProperty._properties.int64Property);
161
216
  }
162
- var initialChangeset = new ChangeSet(testProperty.serialize({ 'dirtyOnly': false }));
217
+ var initialChangeset = new ChangeSet(testProperty.serialize({ dirtyOnly: false }));
163
218
  initialChangeset.setIsNormalized(true);
164
219
  innerTestChangeSetSquashing(testProperty, testProperty._properties.int64Property, initialChangeset, in_options);
165
220
  var initialChangeset = initialChangeset.getSerializedChangeSet();
166
221
  if (ChangeSet.isEmptyChangeSet(initialChangeset)) {
167
222
  // if one is empty the other should be empty, too
168
- expect(testProperty.serialize({ 'dirtyOnly': false })).to.be.empty;
223
+ expect(testProperty.serialize({ dirtyOnly: false })).to.be.empty;
169
224
  }
170
225
  else {
171
226
  // else they must be deep equal
172
- expect(initialChangeset['array<Int64>'].int64Property).to.deep.equal(testProperty.serialize({ 'dirtyOnly': false })['array<Int64>'].int64Property);
227
+ expect(initialChangeset["array<Int64>"].int64Property).to.deep.equal(testProperty.serialize({ dirtyOnly: false })["array<Int64>"].int64Property);
173
228
  }
174
229
  };
175
- it('should work for multiple independent inserts', function () {
176
- testChangeSetSquashing({ callbacks: [insertInt64Value, insertInt64Value, insertInt64Value] });
230
+ it("should work for multiple independent inserts", function () {
231
+ testChangeSetSquashing({
232
+ callbacks: [insertInt64Value, insertInt64Value, insertInt64Value],
233
+ });
177
234
  });
178
- it('should work for inserts followed by removes', function () {
235
+ it("should work for inserts followed by removes", function () {
179
236
  testChangeSetSquashing({
180
- callbacks: [insertInt64Value, insertInt64Value, removeArrayElement, removeArrayElement],
237
+ callbacks: [
238
+ insertInt64Value,
239
+ insertInt64Value,
240
+ removeArrayElement,
241
+ removeArrayElement,
242
+ ],
181
243
  post: function (changeset) {
182
244
  expect(changeset).to.be.empty;
183
245
  },
184
246
  });
185
247
  });
186
- it('should work for mixed modifies and inserts', function () {
248
+ it("should work for mixed modifies and inserts", function () {
187
249
  testChangeSetSquashing({
188
250
  callbacks: [insertInt64Value, modifyInt64Value, insertInt64Value, modifyInt64Value],
189
251
  });
190
252
  });
191
- it('an insert, modify and a remove should give an empty changeset', function () {
253
+ it("an insert, modify and a remove should give an empty changeset", function () {
192
254
  testChangeSetSquashing({
193
255
  callbacks: [insertInt64Value, modifyInt64Value, removeArrayElement],
194
256
  post: function (changeset) {
@@ -196,25 +258,25 @@ describe('Int64ArrayProperty', function () {
196
258
  },
197
259
  });
198
260
  });
199
- it('work for modifies after an already existing insert', function () {
261
+ it("work for modifies after an already existing insert", function () {
200
262
  testChangeSetSquashing({
201
263
  pre: insertInt64Value,
202
264
  callbacks: [modifyInt64Value, modifyInt64Value],
203
265
  });
204
266
  });
205
- it('of modify and remove after an already existing insert should work', function () {
267
+ it("of modify and remove after an already existing insert should work", function () {
206
268
  testChangeSetSquashing({
207
269
  pre: insertInt64Value,
208
270
  callbacks: [modifyInt64Value, removeArrayElement],
209
271
  post: function (changeset) {
210
- expect(changeset['array<Int64>'].int64Property).to.have.all.keys('remove');
272
+ expect(changeset["array<Int64>"].int64Property).to.have.all.keys("remove");
211
273
  },
212
274
  });
213
275
  });
214
276
  });
215
- describe('Rebasing', function () {
277
+ describe("Rebasing", function () {
216
278
  var createPropertyForRebaseTestByTemplate = function () {
217
- return PropertyFactory.create('autodesk.tests:SimpleInt64TestProperty-1.0.0');
279
+ return PropertyFactory.create("autodesk.tests:SimpleInt64TestProperty-1.0.0");
218
280
  };
219
281
  var getint64PropertyFromNode = function (in_testProperty) {
220
282
  return in_testProperty._properties.int64Property;
@@ -227,9 +289,9 @@ describe('Int64ArrayProperty', function () {
227
289
  }
228
290
  // Create two copies of this state
229
291
  var baseProperty2 = in_creator();
230
- baseProperty2.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));
292
+ baseProperty2.deserialize(baseProperty1.serialize({ dirtyOnly: false }));
231
293
  var baseProperty3 = in_creator();
232
- baseProperty3.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));
294
+ baseProperty3.deserialize(baseProperty1.serialize({ dirtyOnly: false }));
233
295
  // Make sure the states are clear
234
296
  baseProperty1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
235
297
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
@@ -237,7 +299,7 @@ describe('Int64ArrayProperty', function () {
237
299
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
238
300
  baseProperty3.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
239
301
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
240
- var initialChangeSet = baseProperty1.serialize({ 'dirtyOnly': false });
302
+ var initialChangeSet = baseProperty1.serialize({ dirtyOnly: false });
241
303
  // Apply the operations to the two properties in parallel
242
304
  if (in_options.op1) {
243
305
  in_options.op1(in_getInnerProperty(baseProperty1));
@@ -246,8 +308,8 @@ describe('Int64ArrayProperty', function () {
246
308
  in_options.op2(in_getInnerProperty(baseProperty2));
247
309
  }
248
310
  // Get the ChangeSets
249
- var changeSet1 = new ChangeSet(baseProperty1.serialize({ 'dirtyOnly': true }));
250
- var changeSet2 = baseProperty2.serialize({ 'dirtyOnly': true });
311
+ var changeSet1 = new ChangeSet(baseProperty1.serialize({ dirtyOnly: true }));
312
+ var changeSet2 = baseProperty2.serialize({ dirtyOnly: true });
251
313
  // Perform the actual rebase
252
314
  var conflicts = [];
253
315
  changeSet1._rebaseChangeSet(changeSet2, conflicts);
@@ -262,7 +324,7 @@ describe('Int64ArrayProperty', function () {
262
324
  if (in_options.op2) {
263
325
  in_options.op2(in_getInnerProperty(baseProperty3));
264
326
  }
265
- var finalChangeSet = baseProperty3.serialize({ 'dirtyOnly': false });
327
+ var finalChangeSet = baseProperty3.serialize({ dirtyOnly: false });
266
328
  if (in_isCollection && finalChangeSet.insert) {
267
329
  finalChangeSet = finalChangeSet.insert;
268
330
  }
@@ -273,7 +335,7 @@ describe('Int64ArrayProperty', function () {
273
335
  }
274
336
  else {
275
337
  // else they must be deep equal
276
- expect(combinedSerialized['array<Int64>'].int64Property).to.deep.equal(finalChangeSet['array<Int64>'].int64Property);
338
+ expect(combinedSerialized["array<Int64>"].int64Property).to.deep.equal(finalChangeSet["array<Int64>"].int64Property);
277
339
  }
278
340
  }
279
341
  if (in_options.checkResult) {
@@ -286,20 +348,20 @@ describe('Int64ArrayProperty', function () {
286
348
  var testRebasing = function (in_options) {
287
349
  testRebasingInner(createPropertyForRebaseTestByTemplate, getint64PropertyFromNode, in_options);
288
350
  };
289
- it('with a NOP should be possible', function () {
351
+ it("with a NOP should be possible", function () {
290
352
  testRebasing({
291
353
  op2: insertInt64Value,
292
354
  compareToSequential: true,
293
355
  });
294
356
  });
295
- it('with independent inserts should be possible', function () {
357
+ it("with independent inserts should be possible", function () {
296
358
  testRebasing({
297
359
  op1: insertInt64Value,
298
360
  op2: insertInt64Value,
299
361
  compareToSequential: true,
300
362
  });
301
363
  });
302
- it('with independent removes should be possible', function () {
364
+ it("with independent removes should be possible", function () {
303
365
  testRebasing({
304
366
  prepare: function (root) {
305
367
  insertInt64Value(root);
@@ -314,7 +376,7 @@ describe('Int64ArrayProperty', function () {
314
376
  compareToSequential: true,
315
377
  });
316
378
  });
317
- it('with a modify and a remove should possible', function () {
379
+ it("with a modify and a remove should possible", function () {
318
380
  testRebasing({
319
381
  prepare: insertInt64Value,
320
382
  op1: modifyInt64Value,
@@ -322,7 +384,7 @@ describe('Int64ArrayProperty', function () {
322
384
  compareToSequential: true,
323
385
  });
324
386
  });
325
- it('with a remove and a modify should possible', function () {
387
+ it("with a remove and a modify should possible", function () {
326
388
  testRebasing({
327
389
  prepare: insertInt64Value,
328
390
  op1: removeArrayElement,
@@ -331,11 +393,11 @@ describe('Int64ArrayProperty', function () {
331
393
  checkResult: function (conflicts, changeSet) {
332
394
  expect(conflicts).to.have.length(1);
333
395
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);
334
- expect(conflicts[0].path).to.be.equal('int64Property');
396
+ expect(conflicts[0].path).to.be.equal("int64Property");
335
397
  },
336
398
  });
337
399
  });
338
- it('with two compatible removes should be possible', function () {
400
+ it("with two compatible removes should be possible", function () {
339
401
  testRebasing({
340
402
  prepare: insertInt64Value,
341
403
  op1: removeArrayElement,
@@ -346,7 +408,7 @@ describe('Int64ArrayProperty', function () {
346
408
  },
347
409
  });
348
410
  });
349
- it('with two independent modifies should be possible', function () {
411
+ it("with two independent modifies should be possible", function () {
350
412
  testRebasing({
351
413
  prepare: function (root) {
352
414
  root.insertRange(0, [new Int64(9, 8), new Int64(11, 21)]);
@@ -361,7 +423,7 @@ describe('Int64ArrayProperty', function () {
361
423
  },
362
424
  });
363
425
  });
364
- it('with two conflicting modifies should be possible and report a conflict', function () {
426
+ it("with two conflicting modifies should be possible and report a conflict", function () {
365
427
  testRebasing({
366
428
  prepare: insertInt64Value,
367
429
  op1: function (int64Prop) {
@@ -371,13 +433,15 @@ describe('Int64ArrayProperty', function () {
371
433
  compareToSequential: true,
372
434
  checkResult: function (conflicts, changeSet) {
373
435
  expect(conflicts).to.have.length(1);
374
- expect(changeSet['array<Int64>'].int64Property.modify[0][1]).to.deep.equal([[0, 2]]);
436
+ expect(changeSet["array<Int64>"].int64Property.modify[0][1]).to.deep.equal([
437
+ [0, 2],
438
+ ]);
375
439
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
376
- expect(conflicts[0].path).to.be.equal('int64Property');
440
+ expect(conflicts[0].path).to.be.equal("int64Property");
377
441
  },
378
442
  });
379
443
  });
380
- it('with modify followed by remove+insert should work', function () {
444
+ it("with modify followed by remove+insert should work", function () {
381
445
  testRebasing({
382
446
  prepare: insertInt64Value,
383
447
  op1: modifyInt64Value,
@@ -389,12 +453,12 @@ describe('Int64ArrayProperty', function () {
389
453
  checkResult: function (conflicts, changeSet) {
390
454
  expect(conflicts).to.have.length(1);
391
455
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.REMOVE_AFTER_MODIFY);
392
- expect(conflicts[0].path).to.be.equal('int64Property');
393
- expect(changeSet['array<Int64>'].int64Property).to.have.all.keys('remove', 'insert');
456
+ expect(conflicts[0].path).to.be.equal("int64Property");
457
+ expect(changeSet["array<Int64>"].int64Property).to.have.all.keys("remove", "insert");
394
458
  },
395
459
  });
396
460
  });
397
- it('with remove + insert followed by modify should report conflict', function () {
461
+ it("with remove + insert followed by modify should report conflict", function () {
398
462
  testRebasing({
399
463
  prepare: insertInt64Value,
400
464
  op1: function (root) {
@@ -406,11 +470,11 @@ describe('Int64ArrayProperty', function () {
406
470
  checkResult: function (conflicts, changeSet) {
407
471
  expect(conflicts).to.have.length(1);
408
472
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);
409
- expect(conflicts[0].path).to.be.equal('int64Property');
473
+ expect(conflicts[0].path).to.be.equal("int64Property");
410
474
  },
411
475
  });
412
476
  });
413
- it('with conflicting inserts should report conflict', function () {
477
+ it("with conflicting inserts should report conflict", function () {
414
478
  testRebasing({
415
479
  prepare: insertInt64Value,
416
480
  op1: insertInt64Value,
@@ -419,7 +483,7 @@ describe('Int64ArrayProperty', function () {
419
483
  checkResult: function (conflicts, changeSet) {
420
484
  expect(conflicts).to.have.length(1);
421
485
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY);
422
- expect(conflicts[0].path).to.be.equal('int64Property');
486
+ expect(conflicts[0].path).to.be.equal("int64Property");
423
487
  },
424
488
  });
425
489
  });