@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.
- package/README.md +1 -0
- package/dist/containerSerializer.d.ts.map +1 -1
- package/dist/containerSerializer.js +5 -5
- package/dist/containerSerializer.js.map +1 -1
- package/dist/enableValidations.js.map +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
- package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.js +70 -53
- package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +152 -103
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts +4 -4
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +69 -47
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +3 -3
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts +8 -8
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +33 -26
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.d.ts.map +1 -1
- package/dist/properties/enumArrayProperty.js +14 -14
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +17 -17
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.js +4 -4
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/index.d.ts +23 -23
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +47 -37
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +10 -10
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/lazyLoadedProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +21 -17
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.d.ts.map +1 -1
- package/dist/properties/namedNodeProperty.js +3 -3
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.d.ts.map +1 -1
- package/dist/properties/namedProperty.js +7 -5
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +5 -3
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/dist/properties/primitiveTypeCasts.js +9 -9
- package/dist/properties/primitiveTypeCasts.js.map +1 -1
- package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
- package/dist/properties/referenceArrayProperty.js +31 -25
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.d.ts.map +1 -1
- package/dist/properties/referenceMapProperty.js +18 -18
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +33 -29
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +31 -29
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +56 -40
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.js +5 -5
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +30 -29
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +31 -29
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/properties/valueProperty.d.ts.map +1 -1
- package/dist/properties/valueProperty.js +11 -9
- package/dist/properties/valueProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +309 -252
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplate.d.ts +17 -17
- package/dist/propertyTemplate.d.ts.map +1 -1
- package/dist/propertyTemplate.js +64 -45
- package/dist/propertyTemplate.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +40 -25
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/propertyUtils.d.ts.map +1 -1
- package/dist/propertyUtils.js.map +1 -1
- package/dist/test/properties/arrayProperty.spec.js +566 -490
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +293 -280
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +100 -94
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +174 -147
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumArrayProperty.spec.js +67 -63
- package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumProperty.spec.js +115 -97
- package/dist/test/properties/enumProperty.spec.js.map +1 -1
- package/dist/test/properties/float32.spec.js +5 -5
- package/dist/test/properties/float32.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64MapProperty.spec.js +185 -166
- package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +109 -109
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +75 -76
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/mapProperty.spec.js +571 -531
- package/dist/test/properties/mapProperty.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +31 -31
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +805 -795
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/referenceProperty.spec.js +729 -679
- package/dist/test/properties/referenceProperty.spec.js.map +1 -1
- package/dist/test/properties/relationshipProperty.spec.js +16 -16
- package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
- package/dist/test/properties/setProperty.spec.js +288 -227
- package/dist/test/properties/setProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +326 -318
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/uint64Property.spec.js +46 -36
- package/dist/test/properties/uint64Property.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +259 -246
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +49 -43
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +2038 -1631
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/propertyTemplateWrapper.spec.js +72 -102
- package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
- package/dist/test/propertyUtils.spec.js +22 -21
- package/dist/test/propertyUtils.spec.js.map +1 -1
- package/dist/test/reversibleChangeset.spec.js +857 -703
- package/dist/test/reversibleChangeset.spec.js.map +1 -1
- package/dist/test/setup.js +5 -5
- package/dist/test/setup.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1
- package/dist/test/utils.spec.js +1334 -1144
- package/dist/test/utils.spec.js.map +1 -1
- package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
- package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/validation/badPrimitiveTypeid.js +12 -12
- package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/validation/goodColorId.js +91 -91
- package/dist/test/validation/goodColorId.js.map +1 -1
- package/dist/test/validation/goodColorPalette.js +4 -4
- package/dist/test/validation/goodColorPalette.js.map +1 -1
- package/dist/test/validation/goodPointId.js +20 -20
- package/dist/test/validation/goodPointId.js.map +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
- package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
- package/lib/containerSerializer.d.ts.map +1 -1
- package/lib/containerSerializer.js +5 -5
- package/lib/containerSerializer.js.map +1 -1
- package/lib/enableValidations.js.map +1 -1
- package/lib/index.d.ts +19 -19
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -19
- package/lib/index.js.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
- package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.js +70 -53
- package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/lib/properties/arrayProperty.d.ts.map +1 -1
- package/lib/properties/arrayProperty.js +152 -103
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.d.ts +4 -4
- package/lib/properties/baseProperty.d.ts.map +1 -1
- package/lib/properties/baseProperty.js +73 -51
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.d.ts.map +1 -1
- package/lib/properties/boolProperty.js +3 -3
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.d.ts +8 -8
- package/lib/properties/containerProperty.d.ts.map +1 -1
- package/lib/properties/containerProperty.js +33 -26
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.d.ts.map +1 -1
- package/lib/properties/enumArrayProperty.js +14 -14
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.d.ts.map +1 -1
- package/lib/properties/enumProperty.js +17 -17
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +4 -4
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/index.d.ts +23 -23
- package/lib/properties/index.d.ts.map +1 -1
- package/lib/properties/index.js +23 -23
- package/lib/properties/index.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +47 -37
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.d.ts.map +1 -1
- package/lib/properties/intProperties.js +10 -10
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/lazyLoadedProperties.js.map +1 -1
- package/lib/properties/mapProperty.d.ts.map +1 -1
- package/lib/properties/mapProperty.js +21 -17
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.d.ts.map +1 -1
- package/lib/properties/namedNodeProperty.js +3 -3
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.d.ts.map +1 -1
- package/lib/properties/namedProperty.js +7 -5
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.d.ts.map +1 -1
- package/lib/properties/nodeProperty.js +5 -3
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/lib/properties/primitiveTypeCasts.js +9 -9
- package/lib/properties/primitiveTypeCasts.js.map +1 -1
- package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
- package/lib/properties/referenceArrayProperty.js +31 -25
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.d.ts.map +1 -1
- package/lib/properties/referenceMapProperty.js +18 -18
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.d.ts.map +1 -1
- package/lib/properties/referenceProperty.js +33 -29
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.d.ts.map +1 -1
- package/lib/properties/setProperty.js +31 -29
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.d.ts.map +1 -1
- package/lib/properties/stringProperty.js +56 -40
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +5 -5
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.d.ts +1 -1
- package/lib/properties/valueArrayProperty.d.ts.map +1 -1
- package/lib/properties/valueArrayProperty.js +30 -29
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.d.ts.map +1 -1
- package/lib/properties/valueMapProperty.js +31 -29
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/properties/valueProperty.d.ts.map +1 -1
- package/lib/properties/valueProperty.js +11 -9
- package/lib/properties/valueProperty.js.map +1 -1
- package/lib/propertyFactory.d.ts.map +1 -1
- package/lib/propertyFactory.js +309 -252
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplate.d.ts +17 -17
- package/lib/propertyTemplate.d.ts.map +1 -1
- package/lib/propertyTemplate.js +64 -45
- package/lib/propertyTemplate.js.map +1 -1
- package/lib/propertyTemplateWrapper.d.ts.map +1 -1
- package/lib/propertyTemplateWrapper.js +40 -25
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/lib/propertyUtils.d.ts.map +1 -1
- package/lib/propertyUtils.js.map +1 -1
- package/package.json +28 -28
- package/src/index.d.ts +2750 -2681
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @fileoverview Definition of the valuearray property class
|
|
7
7
|
*/
|
|
8
|
-
const _ = require(
|
|
9
|
-
const { MSG } = require(
|
|
10
|
-
const { BaseDataArray, UniversalDataArray, BoolDataArray, Uint64, Int64, } = require(
|
|
11
|
-
const { Int64Property, Uint64Property } = require(
|
|
12
|
-
const { _castFunctors } = require(
|
|
13
|
-
const { ArrayProperty } = require(
|
|
8
|
+
const _ = require("lodash");
|
|
9
|
+
const { MSG } = require("@fluid-experimental/property-common").constants;
|
|
10
|
+
const { BaseDataArray, UniversalDataArray, BoolDataArray, Uint64, Int64, } = require("@fluid-experimental/property-common");
|
|
11
|
+
const { Int64Property, Uint64Property } = require("../properties/intProperties");
|
|
12
|
+
const { _castFunctors } = require("./primitiveTypeCasts");
|
|
13
|
+
const { ArrayProperty } = require("./arrayProperty");
|
|
14
14
|
/**
|
|
15
15
|
* An array property which stores primitive values
|
|
16
16
|
*/
|
|
@@ -117,7 +117,7 @@ export class Float32ArrayProperty extends ValueArrayProperty {
|
|
|
117
117
|
this._dataArrayRef = new BaseDataArray(Float32Array, in_length);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
Float32ArrayProperty.prototype._typeid =
|
|
120
|
+
Float32ArrayProperty.prototype._typeid = "Float32";
|
|
121
121
|
/**
|
|
122
122
|
* An ArrayProperty which stores Float64 values
|
|
123
123
|
*/
|
|
@@ -142,7 +142,7 @@ export class Float64ArrayProperty extends ValueArrayProperty {
|
|
|
142
142
|
this._dataArrayRef = new BaseDataArray(Float64Array, in_length);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
Float64ArrayProperty.prototype._typeid =
|
|
145
|
+
Float64ArrayProperty.prototype._typeid = "Float64";
|
|
146
146
|
/**
|
|
147
147
|
* An ArrayProperty which stores Uint8 values
|
|
148
148
|
*/
|
|
@@ -167,11 +167,11 @@ export class Uint8ArrayProperty extends ValueArrayProperty {
|
|
|
167
167
|
this._dataArrayRef = new BaseDataArray(Uint8Array, in_length);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
Uint8ArrayProperty.prototype._typeid =
|
|
170
|
+
Uint8ArrayProperty.prototype._typeid = "Uint8";
|
|
171
171
|
/**
|
|
172
172
|
* An ArrayProperty which stores Int8 values
|
|
173
173
|
*
|
|
174
|
-
*/
|
|
174
|
+
*/
|
|
175
175
|
export class Int8ArrayProperty extends ValueArrayProperty {
|
|
176
176
|
/**
|
|
177
177
|
* @param {Object} in_params - Input parameters for property creation
|
|
@@ -193,7 +193,7 @@ export class Int8ArrayProperty extends ValueArrayProperty {
|
|
|
193
193
|
this._dataArrayRef = new BaseDataArray(Int8Array, in_length);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
Int8ArrayProperty.prototype._typeid =
|
|
196
|
+
Int8ArrayProperty.prototype._typeid = "Int8";
|
|
197
197
|
/**
|
|
198
198
|
* An ArrayProperty which stores Uint16 values
|
|
199
199
|
*/
|
|
@@ -218,7 +218,7 @@ export class Uint16ArrayProperty extends ValueArrayProperty {
|
|
|
218
218
|
this._dataArrayRef = new BaseDataArray(Uint16Array, in_length);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
Uint16ArrayProperty.prototype._typeid =
|
|
221
|
+
Uint16ArrayProperty.prototype._typeid = "Uint16";
|
|
222
222
|
/**
|
|
223
223
|
* An ArrayProperty which stores Int16 values
|
|
224
224
|
*/
|
|
@@ -243,7 +243,7 @@ export class Int16ArrayProperty extends ValueArrayProperty {
|
|
|
243
243
|
this._dataArrayRef = new BaseDataArray(Int16Array, in_length);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
Int16ArrayProperty.prototype._typeid =
|
|
246
|
+
Int16ArrayProperty.prototype._typeid = "Int16";
|
|
247
247
|
/**
|
|
248
248
|
* An ArrayProperty which stores Uint32 values
|
|
249
249
|
*/
|
|
@@ -267,7 +267,7 @@ export class Uint32ArrayProperty extends ValueArrayProperty {
|
|
|
267
267
|
this._dataArrayRef = new BaseDataArray(Uint32Array, in_length);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
Uint32ArrayProperty.prototype._typeid =
|
|
270
|
+
Uint32ArrayProperty.prototype._typeid = "Uint32";
|
|
271
271
|
/**
|
|
272
272
|
* An ArrayProperty which stores Int32 values
|
|
273
273
|
*/
|
|
@@ -292,7 +292,7 @@ export class Int32ArrayProperty extends ValueArrayProperty {
|
|
|
292
292
|
this._dataArrayRef = new BaseDataArray(Int32Array, in_length);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
Int32ArrayProperty.prototype._typeid =
|
|
295
|
+
Int32ArrayProperty.prototype._typeid = "Int32";
|
|
296
296
|
/**
|
|
297
297
|
* An ArrayProperty which stores Int64 values
|
|
298
298
|
*/
|
|
@@ -356,20 +356,21 @@ export class Integer64ArrayProperty extends ValueArrayProperty {
|
|
|
356
356
|
* @inheritdoc
|
|
357
357
|
*/
|
|
358
358
|
_prettyPrint(indent, externalId, printFct) {
|
|
359
|
-
printFct(indent + externalId + this.getId() +
|
|
360
|
-
var childIndent = indent +
|
|
359
|
+
printFct(indent + externalId + this.getId() + " (Array of " + this.getTypeid() + "): [");
|
|
360
|
+
var childIndent = indent + " ";
|
|
361
361
|
var int64Prop;
|
|
362
362
|
for (var i = 0; i < this._dataArrayGetLength(); i++) {
|
|
363
363
|
// TODO: The 'toString()' function is defined on Integer64Property, so we need to create
|
|
364
364
|
// such object to use it. It would be better to have it in Integer64.prototype.toString
|
|
365
|
-
int64Prop =
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
int64Prop =
|
|
366
|
+
this._dataArrayGetValue(i) instanceof Int64
|
|
367
|
+
? new Int64Property({})
|
|
368
|
+
: new Uint64Property({});
|
|
368
369
|
int64Prop.setValueLow(this._dataArrayGetValue(i).getValueLow());
|
|
369
370
|
int64Prop.setValueHigh(this._dataArrayGetValue(i).getValueHigh());
|
|
370
|
-
printFct(childIndent + i +
|
|
371
|
+
printFct(childIndent + i + ": " + int64Prop);
|
|
371
372
|
}
|
|
372
|
-
printFct(indent +
|
|
373
|
+
printFct(indent + "]");
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
376
|
/**
|
|
@@ -398,7 +399,7 @@ export class Int64ArrayProperty extends Integer64ArrayProperty {
|
|
|
398
399
|
*/
|
|
399
400
|
setRange(in_offset, in_array) {
|
|
400
401
|
if (!_.isArray(in_array)) {
|
|
401
|
-
throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY +
|
|
402
|
+
throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + "Int64ArrayProperty.setRange");
|
|
402
403
|
}
|
|
403
404
|
var out_array = in_array.map((element) => {
|
|
404
405
|
return _castFunctors.Int64(element);
|
|
@@ -443,7 +444,7 @@ export class Int64ArrayProperty extends Integer64ArrayProperty {
|
|
|
443
444
|
}
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
|
-
Int64ArrayProperty.prototype._typeid =
|
|
447
|
+
Int64ArrayProperty.prototype._typeid = "Int64";
|
|
447
448
|
/**
|
|
448
449
|
* An ArrayProperty which stores Uint64 values
|
|
449
450
|
*/
|
|
@@ -481,7 +482,7 @@ export class Uint64ArrayProperty extends Integer64ArrayProperty {
|
|
|
481
482
|
*/
|
|
482
483
|
setRange(in_offset, in_array) {
|
|
483
484
|
if (!_.isArray(in_array)) {
|
|
484
|
-
throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY +
|
|
485
|
+
throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + "Uint64ArrayProperty.setRange");
|
|
485
486
|
}
|
|
486
487
|
var out_array = in_array.map((element) => {
|
|
487
488
|
return _castFunctors.Uint64(element);
|
|
@@ -515,7 +516,7 @@ export class Uint64ArrayProperty extends Integer64ArrayProperty {
|
|
|
515
516
|
}
|
|
516
517
|
}
|
|
517
518
|
}
|
|
518
|
-
Uint64ArrayProperty.prototype._typeid =
|
|
519
|
+
Uint64ArrayProperty.prototype._typeid = "Uint64";
|
|
519
520
|
/**
|
|
520
521
|
* An ArrayProperty which stores String values
|
|
521
522
|
*/
|
|
@@ -539,11 +540,11 @@ export class StringArrayProperty extends ValueArrayProperty {
|
|
|
539
540
|
_dataArrayCreate(in_length) {
|
|
540
541
|
this._dataArrayRef = new UniversalDataArray(in_length);
|
|
541
542
|
for (var i = 0; i < in_length; i++) {
|
|
542
|
-
this._dataArraySetValue(i,
|
|
543
|
+
this._dataArraySetValue(i, "");
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
546
|
}
|
|
546
|
-
StringArrayProperty.prototype._typeid =
|
|
547
|
+
StringArrayProperty.prototype._typeid = "String";
|
|
547
548
|
/**
|
|
548
549
|
* An ArrayProperty which stores Boolean values
|
|
549
550
|
*/
|
|
@@ -571,5 +572,5 @@ export class BoolArrayProperty extends ValueArrayProperty {
|
|
|
571
572
|
}
|
|
572
573
|
}
|
|
573
574
|
}
|
|
574
|
-
BoolArrayProperty.prototype._typeid =
|
|
575
|
+
BoolArrayProperty.prototype._typeid = "Bool";
|
|
575
576
|
//# sourceMappingURL=valueArrayProperty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueArrayProperty.js","sourceRoot":"","sources":["../../src/properties/valueArrayProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EACF,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,MAAM,EACN,KAAK,GACR,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACnD,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AACjF,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC1D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IACjD;;;;;;OAMG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3B,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AAE,CAAC,EAAE,EAAE;YAChC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;SAClC;IACL,CAAC;CACJ;AACD,mBAAmB,CAAC,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,kBAAkB;IACrD;;;;;;;;OAQG;IACH,YAAY,SAAS;QACjB,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,SAAS;QACtB,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;SACrC;IACL,CAAC;CACJ;AACD,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the valuearray property class\n */\n\nconst _ = require('lodash');\nconst { MSG } = require('@fluid-experimental/property-common').constants;\nconst {\n BaseDataArray,\n UniversalDataArray,\n BoolDataArray,\n Uint64,\n Int64,\n} = require('@fluid-experimental/property-common');\nconst { Int64Property, Uint64Property } = require('../properties/intProperties');\nconst { _castFunctors } = require('./primitiveTypeCasts');\nconst { ArrayProperty } = require('./arrayProperty');\n\n/**\n * An array property which stores primitive values\n */\nexport class ValueArrayProperty extends ArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n * @constructor\n * @protected\n * @extends property-properties.ArrayProperty\n * @alias property-properties.ValueArrayProperty\n */\n constructor(in_params) {\n super(in_params, true);\n }\n\n /**\n * Returns the value at in_position for a primitive array\n * @param {number} in_position - The array index\n * @return {*} the value\n */\n _getValue(in_position) {\n return this._dataArrayRef.getValue(in_position);\n }\n\n /**\n * returns the array of primitive values.\n * @return {Array<*>} the array of values.\n * For example: ['string1', 'string2']\n */\n getValues() {\n var result = [];\n var ids = this.getIds();\n for (var i = 0; i < ids.length; i++) {\n result.push(this.get(ids[i]));\n }\n return result;\n }\n\n /**\n * Resolves a direct child node based on the given path segment\n *\n * @param {String} in_segment - The path segment to resolve\n * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n *\n * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n * @protected\n */\n _resolvePathSegment(in_segment, in_segmentType) {\n return this.get(in_segment);\n }\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n return in_obj;\n }\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n return in_array;\n }\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj - The serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n return in_serializedObj;\n }\n}\nValueArrayProperty.prototype._isPrimitive = true;\n\n/**\n * An ArrayProperty which stores Float32 values\n */\nexport class Float32ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Float32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Float32Array, in_length);\n }\n}\nFloat32ArrayProperty.prototype._typeid = 'Float32';\n\n/**\n * An ArrayProperty which stores Float64 values\n */\nexport class Float64ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Float64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Float64Array, in_length);\n }\n}\nFloat64ArrayProperty.prototype._typeid = 'Float64';\n\n/**\n * An ArrayProperty which stores Uint8 values\n */\nexport class Uint8ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint8ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Uint8Array, in_length);\n }\n}\nUint8ArrayProperty.prototype._typeid = 'Uint8';\n\n/**\n * An ArrayProperty which stores Int8 values\n *\n*/\nexport class Int8ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int8ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Int8Array, in_length);\n }\n}\nInt8ArrayProperty.prototype._typeid = 'Int8';\n\n/**\n * An ArrayProperty which stores Uint16 values\n */\nexport class Uint16ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint16ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Uint16Array, in_length);\n }\n}\nUint16ArrayProperty.prototype._typeid = 'Uint16';\n\n/**\n * An ArrayProperty which stores Int16 values\n */\nexport class Int16ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int16ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Int16Array, in_length);\n }\n}\nInt16ArrayProperty.prototype._typeid = 'Int16';\n\n/**\n * An ArrayProperty which stores Uint32 values\n */\nexport class Uint32ArrayProperty extends ValueArrayProperty {\n /** @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Uint32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Uint32Array, in_length);\n }\n}\nUint32ArrayProperty.prototype._typeid = 'Uint32';\n\n/**\n * An ArrayProperty which stores Int32 values\n */\nexport class Int32ArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Int32ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BaseDataArray(Int32Array, in_length);\n }\n}\nInt32ArrayProperty.prototype._typeid = 'Int32';\n\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Integer64ArrayProperty extends ValueArrayProperty {\n /** @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.Integer64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Function to serialize special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {*} in_obj - The object to be serialized\n * @return {property-properties.SerializedChangeSet} the serialized object\n */\n _serializeValue(in_obj) {\n if (in_obj instanceof Int64 || in_obj instanceof Uint64) {\n return [in_obj.getValueLow(), in_obj.getValueHigh()];\n }\n return in_obj;\n }\n\n /**\n * Function to serialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on serialization. For supported types, we can just return the input here.\n *\n * @param {Array} in_array - The array of special objects to be serialized\n * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n */\n _serializeArray(in_array) {\n var result = [];\n for (var i = 0; i < in_array.length; i++) {\n result.push(this._serializeValue(in_array[i]));\n }\n return result;\n }\n\n /**\n * Function to deserialize arrays of special primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj - The serialized object\n * @return {Array} in_array - The array of special objects that were deserialized\n */\n _deserializeArray(in_serializedObj) {\n var result = [];\n for (var i = 0; i < in_serializedObj.length; i++) {\n result.push(this._deserializeValue(in_serializedObj[i]));\n }\n return result;\n }\n\n /**\n * @inheritdoc\n */\n _prettyPrint(indent, externalId, printFct) {\n printFct(indent + externalId + this.getId() + ' (Array of ' + this.getTypeid() + '): [');\n var childIndent = indent + ' ';\n var int64Prop;\n for (var i = 0; i < this._dataArrayGetLength(); i++) {\n // TODO: The 'toString()' function is defined on Integer64Property, so we need to create\n // such object to use it. It would be better to have it in Integer64.prototype.toString\n int64Prop = this._dataArrayGetValue(i) instanceof Int64\n ? new Int64Property({})\n : new Uint64Property({});\n int64Prop.setValueLow(this._dataArrayGetValue(i).getValueLow());\n int64Prop.setValueHigh(this._dataArrayGetValue(i).getValueHigh());\n printFct(childIndent + i + ': ' + int64Prop);\n }\n printFct(indent + ']');\n }\n}\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Int64ArrayProperty extends Integer64ArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.Integer64ArrayProperty\n * @alias property-properties.Int64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * @param {number} in_offset - Target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array - contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'Int64ArrayProperty.setRange');\n }\n var out_array = in_array.map((element) => {\n return _castFunctors.Int64(element);\n });\n ArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n }\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset - Target index\n * @param {Array<*>} in_array - The array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if tyring to modify a referenced property.\n */\n insertRange(in_offset, in_array) {\n var out_array = in_array.map((element) => {\n return _castFunctors.Int64(element);\n });\n ArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\n }\n\n /**\n * Specialized function to deserialize Int64 primitive types.\n * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Int64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Int64(in_serializedObj[0], in_serializedObj[1]);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, new Int64());\n }\n }\n}\nInt64ArrayProperty.prototype._typeid = 'Int64';\n\n/**\n * An ArrayProperty which stores Uint64 values\n */\nexport class Uint64ArrayProperty extends Integer64ArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.Integer64ArrayProperty\n * @alias property-properties.Uint64ArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Specialized function to deserialize Uint64 primitive types.\n * Some primitive types (e.g. Uint64, which is not natively supported by javascript) require\n * special treatment on deserialization. For supported types, we can just return the input here.\n *\n * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n * @return {Uint64} the deserialized value\n */\n _deserializeValue(in_serializedObj) {\n return new Uint64(in_serializedObj[0], in_serializedObj[1]);\n }\n\n /**\n * Sets the array properties elements to the content of the given array\n * All changed elements must already exist. This will overwrite existing elements.\n * @param {number} in_offset - Target start index\n * @param {Array<*>|Array<property-properties.BaseProperty>} in_array - contains the elements to be set\n * @throws if in_offset is not a number\n * @throws if in_offset is smaller than zero or higher than the length of the array\n */\n setRange(in_offset, in_array) {\n if (!_.isArray(in_array)) {\n throw new TypeError(MSG.IN_ARRAY_NOT_ARRAY + 'Uint64ArrayProperty.setRange');\n }\n var out_array = in_array.map((element) => {\n return _castFunctors.Uint64(element);\n });\n ArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n }\n\n /**\n * Inserts the content of a given array into the array property\n * It will not overwrite the existing values but push them to the right instead.\n * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n * @param {number} in_offset - Target index\n * @param {Array<*>} in_array - The array to be inserted\n * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n * @throws if trying to insert a property that already has a parent.\n * @throws if tyring to modify a referenced property.\n */\n insertRange(in_offset, in_array) {\n var out_array = in_array.map((element) => {\n return _castFunctors.Uint64(element);\n });\n ArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, new Uint64());\n }\n }\n}\nUint64ArrayProperty.prototype._typeid = 'Uint64';\n\n/**\n * An ArrayProperty which stores String values\n */\nexport class StringArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.StringArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new UniversalDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, '');\n }\n }\n}\nStringArrayProperty.prototype._typeid = 'String';\n\n/**\n * An ArrayProperty which stores Boolean values\n */\nexport class BoolArrayProperty extends ValueArrayProperty {\n /**\n * @param {Object} in_params - Input parameters for property creation\n *\n * @constructor\n * @protected\n * @extends property-properties.ValueArrayProperty\n * @alias property-properties.BoolArrayProperty\n * @category Arrays\n */\n constructor(in_params) {\n super(in_params, Array, true);\n }\n\n /**\n * Creates and initializes the data array\n * @param {Number} in_length - The initial length of the array\n */\n _dataArrayCreate(in_length) {\n this._dataArrayRef = new BoolDataArray(in_length);\n for (var i = 0; i < in_length; i++) {\n this._dataArraySetValue(i, false);\n }\n }\n}\nBoolArrayProperty.prototype._typeid = 'Bool';\n"]}
|
|
1
|
+
{"version":3,"file":"valueArrayProperty.js","sourceRoot":"","sources":["../../src/properties/valueArrayProperty.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC;AACzE,MAAM,EACL,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,MAAM,EACN,KAAK,GACL,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACnD,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AACjF,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC1D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IACpD;;;;;;OAMG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,WAAW;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IAED;;;;OAIG;IACH,SAAS;QACR,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM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OAQG;IACH,YAAY,SAAS;QACpB,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,SAAS;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YACnC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;SAClC;IACF,CAAC;CACD;AACD,iBAAiB,CAAC,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Definition of the valuearray property class\n */\n\nconst _ = require(\"lodash\");\nconst { MSG } = require(\"@fluid-experimental/property-common\").constants;\nconst {\n\tBaseDataArray,\n\tUniversalDataArray,\n\tBoolDataArray,\n\tUint64,\n\tInt64,\n} = require(\"@fluid-experimental/property-common\");\nconst { Int64Property, Uint64Property } = require(\"../properties/intProperties\");\nconst { _castFunctors } = require(\"./primitiveTypeCasts\");\nconst { ArrayProperty } = require(\"./arrayProperty\");\n\n/**\n * An array property which stores primitive values\n */\nexport class ValueArrayProperty extends ArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ArrayProperty\n\t * @alias property-properties.ValueArrayProperty\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params, true);\n\t}\n\n\t/**\n\t * Returns the value at in_position for a primitive array\n\t * @param {number} in_position - The array index\n\t * @return {*} the value\n\t */\n\t_getValue(in_position) {\n\t\treturn this._dataArrayRef.getValue(in_position);\n\t}\n\n\t/**\n\t * returns the array of primitive values.\n\t * @return {Array<*>} the array of values.\n\t * For example: ['string1', 'string2']\n\t */\n\tgetValues() {\n\t\tvar result = [];\n\t\tvar ids = this.getIds();\n\t\tfor (var i = 0; i < ids.length; i++) {\n\t\t\tresult.push(this.get(ids[i]));\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Resolves a direct child node based on the given path segment\n\t *\n\t * @param {String} in_segment - The path segment to resolve\n\t * @param {property-properties.PathHelper.TOKEN_TYPES} in_segmentType - The type of segment in the tokenized path\n\t *\n\t * @return {property-properties.BaseProperty|undefined} The child property that has been resolved\n\t * @protected\n\t */\n\t_resolvePathSegment(in_segment, in_segmentType) {\n\t\treturn this.get(in_segment);\n\t}\n\n\t/**\n\t * Function to serialize special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on serialization. For supported types, we can just return the input here.\n\t *\n\t * @param {*} in_obj - The object to be serialized\n\t * @return {property-properties.SerializedChangeSet} the serialized object\n\t */\n\t_serializeValue(in_obj) {\n\t\treturn in_obj;\n\t}\n\n\t/**\n\t * Function to serialize arrays of special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on serialization. For supported types, we can just return the input here.\n\t *\n\t * @param {Array} in_array - The array of special objects to be serialized\n\t * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n\t */\n\t_serializeArray(in_array) {\n\t\treturn in_array;\n\t}\n\n\t/**\n\t * Function to deserialize arrays of special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj - The serialized object\n\t * @return {Array} in_array - The array of special objects that were deserialized\n\t */\n\t_deserializeArray(in_serializedObj) {\n\t\treturn in_serializedObj;\n\t}\n}\nValueArrayProperty.prototype._isPrimitive = true;\n\n/**\n * An ArrayProperty which stores Float32 values\n */\nexport class Float32ArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Float32ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Float32Array, in_length);\n\t}\n}\nFloat32ArrayProperty.prototype._typeid = \"Float32\";\n\n/**\n * An ArrayProperty which stores Float64 values\n */\nexport class Float64ArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Float64ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Float64Array, in_length);\n\t}\n}\nFloat64ArrayProperty.prototype._typeid = \"Float64\";\n\n/**\n * An ArrayProperty which stores Uint8 values\n */\nexport class Uint8ArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Uint8ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Uint8Array, in_length);\n\t}\n}\nUint8ArrayProperty.prototype._typeid = \"Uint8\";\n\n/**\n * An ArrayProperty which stores Int8 values\n *\n */\nexport class Int8ArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Int8ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Int8Array, in_length);\n\t}\n}\nInt8ArrayProperty.prototype._typeid = \"Int8\";\n\n/**\n * An ArrayProperty which stores Uint16 values\n */\nexport class Uint16ArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Uint16ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Uint16Array, in_length);\n\t}\n}\nUint16ArrayProperty.prototype._typeid = \"Uint16\";\n\n/**\n * An ArrayProperty which stores Int16 values\n */\nexport class Int16ArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Int16ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Int16Array, in_length);\n\t}\n}\nInt16ArrayProperty.prototype._typeid = \"Int16\";\n\n/**\n * An ArrayProperty which stores Uint32 values\n */\nexport class Uint32ArrayProperty extends ValueArrayProperty {\n\t/** @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Uint32ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Uint32Array, in_length);\n\t}\n}\nUint32ArrayProperty.prototype._typeid = \"Uint32\";\n\n/**\n * An ArrayProperty which stores Int32 values\n */\nexport class Int32ArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Int32ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BaseDataArray(Int32Array, in_length);\n\t}\n}\nInt32ArrayProperty.prototype._typeid = \"Int32\";\n\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Integer64ArrayProperty extends ValueArrayProperty {\n\t/** @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.Integer64ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Function to serialize special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on serialization. For supported types, we can just return the input here.\n\t *\n\t * @param {*} in_obj - The object to be serialized\n\t * @return {property-properties.SerializedChangeSet} the serialized object\n\t */\n\t_serializeValue(in_obj) {\n\t\tif (in_obj instanceof Int64 || in_obj instanceof Uint64) {\n\t\t\treturn [in_obj.getValueLow(), in_obj.getValueHigh()];\n\t\t}\n\t\treturn in_obj;\n\t}\n\n\t/**\n\t * Function to serialize arrays of special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on serialization. For supported types, we can just return the input here.\n\t *\n\t * @param {Array} in_array - The array of special objects to be serialized\n\t * @return {Array<property-properties.SerializedChangeSet>} the serialized object\n\t */\n\t_serializeArray(in_array) {\n\t\tvar result = [];\n\t\tfor (var i = 0; i < in_array.length; i++) {\n\t\t\tresult.push(this._serializeValue(in_array[i]));\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Function to deserialize arrays of special primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {Array<property-properties.SerializedChangeSet>} in_serializedObj - The serialized object\n\t * @return {Array} in_array - The array of special objects that were deserialized\n\t */\n\t_deserializeArray(in_serializedObj) {\n\t\tvar result = [];\n\t\tfor (var i = 0; i < in_serializedObj.length; i++) {\n\t\t\tresult.push(this._deserializeValue(in_serializedObj[i]));\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\t_prettyPrint(indent, externalId, printFct) {\n\t\tprintFct(indent + externalId + this.getId() + \" (Array of \" + this.getTypeid() + \"): [\");\n\t\tvar childIndent = indent + \" \";\n\t\tvar int64Prop;\n\t\tfor (var i = 0; i < this._dataArrayGetLength(); i++) {\n\t\t\t// TODO: The 'toString()' function is defined on Integer64Property, so we need to create\n\t\t\t// such object to use it. It would be better to have it in Integer64.prototype.toString\n\t\t\tint64Prop =\n\t\t\t\tthis._dataArrayGetValue(i) instanceof Int64\n\t\t\t\t\t? new Int64Property({})\n\t\t\t\t\t: new Uint64Property({});\n\t\t\tint64Prop.setValueLow(this._dataArrayGetValue(i).getValueLow());\n\t\t\tint64Prop.setValueHigh(this._dataArrayGetValue(i).getValueHigh());\n\t\t\tprintFct(childIndent + i + \": \" + int64Prop);\n\t\t}\n\t\tprintFct(indent + \"]\");\n\t}\n}\n/**\n * An ArrayProperty which stores Int64 values\n */\nexport class Int64ArrayProperty extends Integer64ArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.Integer64ArrayProperty\n\t * @alias property-properties.Int64ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Sets the array properties elements to the content of the given array\n\t * All changed elements must already exist. This will overwrite existing elements.\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<*>|Array<property-properties.BaseProperty>} in_array - contains the elements to be set\n\t * @throws if in_offset is not a number\n\t * @throws if in_offset is smaller than zero or higher than the length of the array\n\t */\n\tsetRange(in_offset, in_array) {\n\t\tif (!_.isArray(in_array)) {\n\t\t\tthrow new TypeError(MSG.IN_ARRAY_NOT_ARRAY + \"Int64ArrayProperty.setRange\");\n\t\t}\n\t\tvar out_array = in_array.map((element) => {\n\t\t\treturn _castFunctors.Int64(element);\n\t\t});\n\t\tArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n\t}\n\n\t/**\n\t * Inserts the content of a given array into the array property\n\t * It will not overwrite the existing values but push them to the right instead.\n\t * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n\t * @param {number} in_offset - Target index\n\t * @param {Array<*>} in_array - The array to be inserted\n\t * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n\t * @throws if trying to insert a property that already has a parent.\n\t * @throws if tyring to modify a referenced property.\n\t */\n\tinsertRange(in_offset, in_array) {\n\t\tvar out_array = in_array.map((element) => {\n\t\t\treturn _castFunctors.Int64(element);\n\t\t});\n\t\tArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\n\t}\n\n\t/**\n\t * Specialized function to deserialize Int64 primitive types.\n\t * Some primitive types (e.g. Int64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n\t * @return {Int64} the deserialized value\n\t */\n\t_deserializeValue(in_serializedObj) {\n\t\treturn new Int64(in_serializedObj[0], in_serializedObj[1]);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new UniversalDataArray(in_length);\n\t\tfor (var i = 0; i < in_length; i++) {\n\t\t\tthis._dataArraySetValue(i, new Int64());\n\t\t}\n\t}\n}\nInt64ArrayProperty.prototype._typeid = \"Int64\";\n\n/**\n * An ArrayProperty which stores Uint64 values\n */\nexport class Uint64ArrayProperty extends Integer64ArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.Integer64ArrayProperty\n\t * @alias property-properties.Uint64ArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Specialized function to deserialize Uint64 primitive types.\n\t * Some primitive types (e.g. Uint64, which is not natively supported by javascript) require\n\t * special treatment on deserialization. For supported types, we can just return the input here.\n\t *\n\t * @param {property-properties.SerializedChangeSet} in_serializedObj - The object to be deserialized\n\t * @return {Uint64} the deserialized value\n\t */\n\t_deserializeValue(in_serializedObj) {\n\t\treturn new Uint64(in_serializedObj[0], in_serializedObj[1]);\n\t}\n\n\t/**\n\t * Sets the array properties elements to the content of the given array\n\t * All changed elements must already exist. This will overwrite existing elements.\n\t * @param {number} in_offset - Target start index\n\t * @param {Array<*>|Array<property-properties.BaseProperty>} in_array - contains the elements to be set\n\t * @throws if in_offset is not a number\n\t * @throws if in_offset is smaller than zero or higher than the length of the array\n\t */\n\tsetRange(in_offset, in_array) {\n\t\tif (!_.isArray(in_array)) {\n\t\t\tthrow new TypeError(MSG.IN_ARRAY_NOT_ARRAY + \"Uint64ArrayProperty.setRange\");\n\t\t}\n\t\tvar out_array = in_array.map((element) => {\n\t\t\treturn _castFunctors.Uint64(element);\n\t\t});\n\t\tArrayProperty.prototype.setRange.call(this, in_offset, out_array);\n\t}\n\n\t/**\n\t * Inserts the content of a given array into the array property\n\t * It will not overwrite the existing values but push them to the right instead.\n\t * E.g. [1, 2, 3] .insertRange(1, [9, 8]) => [1, 9, 8, 2, 3]\n\t * @param {number} in_offset - Target index\n\t * @param {Array<*>} in_array - The array to be inserted\n\t * @throws if in_offset is smaller than zero, larger than the length of the array or not a number.\n\t * @throws if trying to insert a property that already has a parent.\n\t * @throws if tyring to modify a referenced property.\n\t */\n\tinsertRange(in_offset, in_array) {\n\t\tvar out_array = in_array.map((element) => {\n\t\t\treturn _castFunctors.Uint64(element);\n\t\t});\n\t\tArrayProperty.prototype.insertRange.call(this, in_offset, out_array);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new UniversalDataArray(in_length);\n\t\tfor (var i = 0; i < in_length; i++) {\n\t\t\tthis._dataArraySetValue(i, new Uint64());\n\t\t}\n\t}\n}\nUint64ArrayProperty.prototype._typeid = \"Uint64\";\n\n/**\n * An ArrayProperty which stores String values\n */\nexport class StringArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.StringArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new UniversalDataArray(in_length);\n\t\tfor (var i = 0; i < in_length; i++) {\n\t\t\tthis._dataArraySetValue(i, \"\");\n\t\t}\n\t}\n}\nStringArrayProperty.prototype._typeid = \"String\";\n\n/**\n * An ArrayProperty which stores Boolean values\n */\nexport class BoolArrayProperty extends ValueArrayProperty {\n\t/**\n\t * @param {Object} in_params - Input parameters for property creation\n\t *\n\t * @constructor\n\t * @protected\n\t * @extends property-properties.ValueArrayProperty\n\t * @alias property-properties.BoolArrayProperty\n\t * @category Arrays\n\t */\n\tconstructor(in_params) {\n\t\tsuper(in_params, Array, true);\n\t}\n\n\t/**\n\t * Creates and initializes the data array\n\t * @param {Number} in_length - The initial length of the array\n\t */\n\t_dataArrayCreate(in_length) {\n\t\tthis._dataArrayRef = new BoolDataArray(in_length);\n\t\tfor (var i = 0; i < in_length; i++) {\n\t\t\tthis._dataArraySetValue(i, false);\n\t\t}\n\t}\n}\nBoolArrayProperty.prototype._typeid = \"Bool\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueMapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/valueMapProperty.js"],"names":[],"mappings":"AAiBA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"valueMapProperty.d.ts","sourceRoot":"","sources":["../../src/properties/valueMapProperty.js"],"names":[],"mappings":"AAiBA;;GAEG;AACH;IACC;;;;;;;;OAQG;IACH,wBAEC;IA4FD,4BAEC;CAyED;AAID;;GAEG;AACH;IAeA,kBAAyC;CAFxC;AAID;;GAEG;AACH;IAeA,kBAAyC;CAFxC;AAID;;GAEG;AACH;IAeA,kBAAwC;CAFvC;AAID;;GAEG;AACH;IAeA,kBAAwC;CAFvC;AAID;;GAEG;AACH;IAeA,kBAAuC;CAFtC;AAID;;GAEG;AACH;IAeA,kBAAuC;CAFtC;AAID;;GAEG;AACH;CAiEC;AAED;;GAEG;AACH;IA2BA,8DAAuC;CAFtC;AAID;;GAEG;AACH;IA2BA,8DAAwC;CAFvC;AAID;;GAEG;AACH;IAcA,kBAAuC;CAFtC;AAID;;GAEG;AACH;IAeA,kBAAsC;CAFrC;AAID;;GAEG;AACH;IAeA,2CAAwC;CAFvC;AAID;;GAEG;AACH;IAeA,6CAAsC;CAFrC"}
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @fileoverview Definition of the valuemap property class
|
|
7
7
|
*/
|
|
8
|
-
const _ = require(
|
|
9
|
-
const { MSG } = require(
|
|
10
|
-
const { Int64, Uint64 } = require(
|
|
11
|
-
const { Int64Property, Uint64Property } = require(
|
|
12
|
-
const { validationsEnabled } = require(
|
|
13
|
-
const { _castFunctors } = require(
|
|
14
|
-
const { BaseProperty } = require(
|
|
15
|
-
const { MapProperty } = require(
|
|
8
|
+
const _ = require("lodash");
|
|
9
|
+
const { MSG } = require("@fluid-experimental/property-common").constants;
|
|
10
|
+
const { Int64, Uint64 } = require("@fluid-experimental/property-common");
|
|
11
|
+
const { Int64Property, Uint64Property } = require("../properties/intProperties");
|
|
12
|
+
const { validationsEnabled } = require("../enableValidations");
|
|
13
|
+
const { _castFunctors } = require("./primitiveTypeCasts");
|
|
14
|
+
const { BaseProperty } = require("./baseProperty");
|
|
15
|
+
const { MapProperty } = require("./mapProperty");
|
|
16
16
|
/**
|
|
17
17
|
* A ValueMapProperty is a collection class that can contain an dictionary that maps from strings to primitive types.
|
|
18
18
|
*/
|
|
@@ -50,7 +50,7 @@ export class ValueMapProperty extends MapProperty {
|
|
|
50
50
|
* 'secondString': 'test2'
|
|
51
51
|
* }
|
|
52
52
|
* ```
|
|
53
|
-
|
|
53
|
+
*/
|
|
54
54
|
getValues() {
|
|
55
55
|
var ids = this.getIds();
|
|
56
56
|
var result = {};
|
|
@@ -80,15 +80,15 @@ export class ValueMapProperty extends MapProperty {
|
|
|
80
80
|
* @param {function} printFct - Function to call for printing each property
|
|
81
81
|
*/
|
|
82
82
|
_prettyPrintChildren(indent, printFct) {
|
|
83
|
-
indent +=
|
|
84
|
-
var prefix =
|
|
85
|
-
var suffix =
|
|
86
|
-
if (this.getTypeid() ===
|
|
83
|
+
indent += " ";
|
|
84
|
+
var prefix = "";
|
|
85
|
+
var suffix = "";
|
|
86
|
+
if (this.getTypeid() === "String") {
|
|
87
87
|
prefix = '"';
|
|
88
88
|
suffix = '"';
|
|
89
89
|
}
|
|
90
90
|
_.mapValues(this._dynamicChildren, function (val, key) {
|
|
91
|
-
printFct(indent + key +
|
|
91
|
+
printFct(indent + key + ": " + prefix + val + suffix);
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -154,7 +154,9 @@ export class ValueMapProperty extends MapProperty {
|
|
|
154
154
|
}
|
|
155
155
|
// Modify entries
|
|
156
156
|
if (in_pendingChangeSet.modify) {
|
|
157
|
-
var modifiedPendingEntries = in_pendingChangeSet
|
|
157
|
+
var modifiedPendingEntries = in_pendingChangeSet
|
|
158
|
+
? in_pendingChangeSet.modify || {}
|
|
159
|
+
: {};
|
|
158
160
|
var modifiedDirtyEntries = in_dirtyChangeSet ? in_dirtyChangeSet.modify || {} : {};
|
|
159
161
|
keys = Object.keys(modifiedPendingEntries).concat(Object.keys(modifiedDirtyEntries));
|
|
160
162
|
for (i = 0; i < keys.length; i++) {
|
|
@@ -200,7 +202,7 @@ export class Float32MapProperty extends ValueMapProperty {
|
|
|
200
202
|
super(in_params);
|
|
201
203
|
}
|
|
202
204
|
}
|
|
203
|
-
Float32MapProperty.prototype._typeid =
|
|
205
|
+
Float32MapProperty.prototype._typeid = "Float32";
|
|
204
206
|
Float32MapProperty.prototype._castFunctor = _castFunctors.Float32;
|
|
205
207
|
/**
|
|
206
208
|
* A ValueMapProperty which stores Float64 values
|
|
@@ -219,7 +221,7 @@ export class Float64MapProperty extends ValueMapProperty {
|
|
|
219
221
|
super(in_params);
|
|
220
222
|
}
|
|
221
223
|
}
|
|
222
|
-
Float64MapProperty.prototype._typeid =
|
|
224
|
+
Float64MapProperty.prototype._typeid = "Float64";
|
|
223
225
|
Float64MapProperty.prototype._castFunctor = _castFunctors.Float64;
|
|
224
226
|
/**
|
|
225
227
|
* A ValueMapProperty which stores Uint32 values
|
|
@@ -238,7 +240,7 @@ export class Uint32MapProperty extends ValueMapProperty {
|
|
|
238
240
|
super(in_params);
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
|
-
Uint32MapProperty.prototype._typeid =
|
|
243
|
+
Uint32MapProperty.prototype._typeid = "Uint32";
|
|
242
244
|
Uint32MapProperty.prototype._castFunctor = _castFunctors.Uint32;
|
|
243
245
|
/**
|
|
244
246
|
* A ValueMapProperty which stores Uint16 values
|
|
@@ -257,7 +259,7 @@ export class Uint16MapProperty extends ValueMapProperty {
|
|
|
257
259
|
super(in_params);
|
|
258
260
|
}
|
|
259
261
|
}
|
|
260
|
-
Uint16MapProperty.prototype._typeid =
|
|
262
|
+
Uint16MapProperty.prototype._typeid = "Uint16";
|
|
261
263
|
Uint16MapProperty.prototype._castFunctor = _castFunctors.Uint16;
|
|
262
264
|
/**
|
|
263
265
|
* A ValueMapProperty which stores Uint8 values
|
|
@@ -276,7 +278,7 @@ export class Uint8MapProperty extends ValueMapProperty {
|
|
|
276
278
|
super(in_params);
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
|
-
Uint8MapProperty.prototype._typeid =
|
|
281
|
+
Uint8MapProperty.prototype._typeid = "Uint8";
|
|
280
282
|
Uint8MapProperty.prototype._castFunctor = _castFunctors.Uint8;
|
|
281
283
|
/**
|
|
282
284
|
* A ValueMapProperty which stores Int32 values
|
|
@@ -295,7 +297,7 @@ export class Int32MapProperty extends ValueMapProperty {
|
|
|
295
297
|
super(in_params);
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
|
-
Int32MapProperty.prototype._typeid =
|
|
300
|
+
Int32MapProperty.prototype._typeid = "Int32";
|
|
299
301
|
Int32MapProperty.prototype._castFunctor = _castFunctors.Int32;
|
|
300
302
|
/**
|
|
301
303
|
* An abstract base class for 64 bit integer map properties
|
|
@@ -350,7 +352,7 @@ export class Integer64MapProperty extends ValueMapProperty {
|
|
|
350
352
|
* @inheritdoc
|
|
351
353
|
*/
|
|
352
354
|
_prettyPrintChildren(indent, printFct) {
|
|
353
|
-
indent +=
|
|
355
|
+
indent += " ";
|
|
354
356
|
var int64Prop;
|
|
355
357
|
_.mapValues(this._dynamicChildren, function (val, key) {
|
|
356
358
|
// TODO: The 'toString()' function is defined on Integer64Property, so we need to create
|
|
@@ -358,7 +360,7 @@ export class Integer64MapProperty extends ValueMapProperty {
|
|
|
358
360
|
int64Prop = val instanceof Int64 ? new Int64Property({}) : new Uint64Property({});
|
|
359
361
|
int64Prop.setValueLow(val.getValueLow());
|
|
360
362
|
int64Prop.setValueHigh(val.getValueHigh());
|
|
361
|
-
printFct(indent + key +
|
|
363
|
+
printFct(indent + key + ": " + int64Prop);
|
|
362
364
|
});
|
|
363
365
|
}
|
|
364
366
|
}
|
|
@@ -390,7 +392,7 @@ export class Int64MapProperty extends Integer64MapProperty {
|
|
|
390
392
|
return new Int64(in_serializedObj[0], in_serializedObj[1]);
|
|
391
393
|
}
|
|
392
394
|
}
|
|
393
|
-
Int64MapProperty.prototype._typeid =
|
|
395
|
+
Int64MapProperty.prototype._typeid = "Int64";
|
|
394
396
|
Int64MapProperty.prototype._castFunctor = _castFunctors.Int64;
|
|
395
397
|
/**
|
|
396
398
|
* A ValueMapProperty which stores Uint64 Properties
|
|
@@ -420,7 +422,7 @@ export class Uint64MapProperty extends Integer64MapProperty {
|
|
|
420
422
|
return new Uint64(in_serializedObj[0], in_serializedObj[1]);
|
|
421
423
|
}
|
|
422
424
|
}
|
|
423
|
-
Uint64MapProperty.prototype._typeid =
|
|
425
|
+
Uint64MapProperty.prototype._typeid = "Uint64";
|
|
424
426
|
Uint64MapProperty.prototype._castFunctor = _castFunctors.Uint64;
|
|
425
427
|
/**
|
|
426
428
|
* A ValueMapProperty which stores Int16 values
|
|
@@ -438,7 +440,7 @@ export class Int16MapProperty extends ValueMapProperty {
|
|
|
438
440
|
super(in_params);
|
|
439
441
|
}
|
|
440
442
|
}
|
|
441
|
-
Int16MapProperty.prototype._typeid =
|
|
443
|
+
Int16MapProperty.prototype._typeid = "Int16";
|
|
442
444
|
Int16MapProperty.prototype._castFunctor = _castFunctors.Int16;
|
|
443
445
|
/**
|
|
444
446
|
* A ValueMapProperty which stores Int8 values
|
|
@@ -457,7 +459,7 @@ export class Int8MapProperty extends ValueMapProperty {
|
|
|
457
459
|
super(in_params);
|
|
458
460
|
}
|
|
459
461
|
}
|
|
460
|
-
Int8MapProperty.prototype._typeid =
|
|
462
|
+
Int8MapProperty.prototype._typeid = "Int8";
|
|
461
463
|
Int8MapProperty.prototype._castFunctor = _castFunctors.Int8;
|
|
462
464
|
/**
|
|
463
465
|
* A ValueMapProperty which stores string values
|
|
@@ -476,7 +478,7 @@ export class StringMapProperty extends ValueMapProperty {
|
|
|
476
478
|
super(in_params);
|
|
477
479
|
}
|
|
478
480
|
}
|
|
479
|
-
StringMapProperty.prototype._typeid =
|
|
481
|
+
StringMapProperty.prototype._typeid = "String";
|
|
480
482
|
StringMapProperty.prototype._castFunctor = _castFunctors.String;
|
|
481
483
|
/**
|
|
482
484
|
* A ValueMapProperty which stores boolean values
|
|
@@ -495,6 +497,6 @@ export class BoolMapProperty extends ValueMapProperty {
|
|
|
495
497
|
super(in_params);
|
|
496
498
|
}
|
|
497
499
|
}
|
|
498
|
-
BoolMapProperty.prototype._typeid =
|
|
500
|
+
BoolMapProperty.prototype._typeid = "Bool";
|
|
499
501
|
BoolMapProperty.prototype._castFunctor = _castFunctors.Boolean;
|
|
500
502
|
//# sourceMappingURL=valueMapProperty.js.map
|