@fluid-experimental/property-common 1.2.2 → 2.0.0-internal.1.0.0.81589
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/dist/consoleUtils.d.ts +2 -2
- package/dist/consoleUtils.js +2 -2
- package/dist/consoleUtils.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/datastructures/collection.d.ts +5 -5
- package/dist/datastructures/collection.js +5 -5
- package/dist/datastructures/collection.js.map +1 -1
- package/dist/datastructures/dataArray.d.ts +7 -7
- package/dist/datastructures/dataArray.d.ts.map +1 -1
- package/dist/datastructures/dataArray.js +7 -7
- package/dist/datastructures/dataArray.js.map +1 -1
- package/dist/datastructures/integer64.d.ts +4 -4
- package/dist/datastructures/integer64.d.ts.map +1 -1
- package/dist/datastructures/integer64.js +9 -9
- package/dist/datastructures/integer64.js.map +1 -1
- package/dist/datastructures/sortedCollection.d.ts +1 -1
- package/dist/datastructures/sortedCollection.js +1 -1
- package/dist/datastructures/sortedCollection.js.map +1 -1
- package/dist/error_objects/flaggedError.js +3 -3
- package/dist/error_objects/flaggedError.js.map +1 -1
- package/dist/guidUtils.d.ts.map +1 -1
- package/dist/guidUtils.js +2 -3
- package/dist/guidUtils.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/consoleUtils.d.ts +2 -2
- package/lib/consoleUtils.js +2 -2
- package/lib/consoleUtils.js.map +1 -1
- package/lib/constants.d.ts +1 -1
- package/lib/constants.js +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/datastructures/collection.d.ts +5 -5
- package/lib/datastructures/collection.js +5 -5
- package/lib/datastructures/collection.js.map +1 -1
- package/lib/datastructures/dataArray.d.ts +7 -7
- package/lib/datastructures/dataArray.d.ts.map +1 -1
- package/lib/datastructures/dataArray.js +7 -7
- package/lib/datastructures/dataArray.js.map +1 -1
- package/lib/datastructures/integer64.d.ts +4 -4
- package/lib/datastructures/integer64.d.ts.map +1 -1
- package/lib/datastructures/integer64.js +9 -9
- package/lib/datastructures/integer64.js.map +1 -1
- package/lib/datastructures/sortedCollection.d.ts +1 -1
- package/lib/datastructures/sortedCollection.js +1 -1
- package/lib/datastructures/sortedCollection.js.map +1 -1
- package/lib/error_objects/flaggedError.js +3 -3
- package/lib/error_objects/flaggedError.js.map +1 -1
- package/lib/guidUtils.d.ts.map +1 -1
- package/lib/guidUtils.js +2 -3
- package/lib/guidUtils.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +2 -2
- package/platform-dependent/package.json +1 -1
- package/src/consoleUtils.ts +2 -2
- package/src/constants.ts +1 -1
- package/src/datastructures/collection.ts +5 -5
- package/src/datastructures/dataArray.ts +8 -7
- package/src/datastructures/integer64.ts +10 -9
- package/src/datastructures/sortedCollection.ts +1 -1
- package/src/error_objects/flaggedError.ts +3 -3
- package/src/guidUtils.ts +2 -3
- package/src/packageVersion.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/property-common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.0.0-internal.1.0.0.81589",
|
|
4
4
|
"description": "common functions used in properties",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@fluidframework/build-common": "^0.24.0",
|
|
72
72
|
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
73
|
-
"@fluidframework/mocha-test-setup": "
|
|
73
|
+
"@fluidframework/mocha-test-setup": "2.0.0-internal.1.0.0.81589",
|
|
74
74
|
"@microsoft/api-extractor": "^7.22.2",
|
|
75
75
|
"@rushstack/eslint-config": "^2.5.1",
|
|
76
76
|
"@types/debug": "^4.1.5",
|
package/src/consoleUtils.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
export class ConsoleUtils { // eslint-disable-line @typescript-eslint/no-extraneous-class
|
|
10
10
|
/**
|
|
11
11
|
* Throws an error if the in_condition is false
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
12
|
+
* @param in_condition - The condition we are testing: a boolean expression.
|
|
13
|
+
* @param in_message - The error message that will be thrown if the condition is false.
|
|
14
14
|
*/
|
|
15
15
|
static assert(condition: any, message: string | number): asserts condition {
|
|
16
16
|
if (!(condition as boolean)) {
|
package/src/constants.ts
CHANGED
|
@@ -1248,7 +1248,7 @@ const PropertyFactoryError = {
|
|
|
1248
1248
|
/**
|
|
1249
1249
|
* methods: PropertyFactory.initializeSchemaStore
|
|
1250
1250
|
* Warning: The initializeSchemaStore method must be provided with an options object
|
|
1251
|
-
|
|
1251
|
+
* containing a getBearerToken function and the url to the ForgeSchemaService.
|
|
1252
1252
|
*/
|
|
1253
1253
|
MISSING_FSS_INIT_OPTIONS: "PF-065: The initializeSchemaStore method must be provided with an options object " +
|
|
1254
1254
|
"containing a getBearerToken function and the url to the ForgeSchemaService.",
|
|
@@ -144,7 +144,7 @@ export class Collection<T> {
|
|
|
144
144
|
/**
|
|
145
145
|
* Filter out by function
|
|
146
146
|
* @param in_filterFunction - with arguments key and item
|
|
147
|
-
* @returns
|
|
147
|
+
* @returns A new filtered collection
|
|
148
148
|
*/
|
|
149
149
|
filter(in_filterFunction: (key: string, item: T) => boolean): Collection<T> {
|
|
150
150
|
const rtn = new Collection<T>();
|
|
@@ -309,9 +309,9 @@ export class Collection<T> {
|
|
|
309
309
|
/**
|
|
310
310
|
* Set an existing key to a value. If key doesn't exist this call will throw
|
|
311
311
|
* an error.
|
|
312
|
-
* @param in_key -
|
|
313
|
-
* @param
|
|
314
|
-
* @returns
|
|
312
|
+
* @param in_key - The key we want to modify
|
|
313
|
+
* @param in_value - The value we are to set at this key
|
|
314
|
+
* @returns The value passed in
|
|
315
315
|
*/
|
|
316
316
|
set(in_key: string, in_value: T) {
|
|
317
317
|
this._checkKeyExists(in_key);
|
|
@@ -324,7 +324,7 @@ export class Collection<T> {
|
|
|
324
324
|
/**
|
|
325
325
|
* Iterate over this collection and run the callback with passing the key and
|
|
326
326
|
* item in the iteration loop.
|
|
327
|
-
* @param
|
|
327
|
+
* @param in_callback - A function that we will call on each item
|
|
328
328
|
* of this collection. If the callback returns false then the iteration will exit early.
|
|
329
329
|
*/
|
|
330
330
|
iterate(in_callback) {
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
7
7
|
/* eslint accessor-pairs: [2, { "getWithoutSet": false }] */
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
|
-
|
|
10
|
+
* The data arrays definition file.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -251,9 +252,9 @@ class BaseDataArray {
|
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
/**
|
|
254
|
-
*
|
|
255
|
-
* @param size -
|
|
256
|
-
* @returns
|
|
255
|
+
* Change the size of the array
|
|
256
|
+
* @param size - The target size
|
|
257
|
+
* @returns The DataArray itself
|
|
257
258
|
*/
|
|
258
259
|
resize(size: number) { // this can be costly!!!
|
|
259
260
|
this._alloc(size);
|
|
@@ -351,9 +352,9 @@ class UniversalDataArray extends BaseDataArray {
|
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
/**
|
|
354
|
-
*
|
|
355
|
-
* @param in_offset -
|
|
356
|
-
* @param
|
|
355
|
+
* Insert the content of an array into the DataArray
|
|
356
|
+
* @param in_offset - The target index
|
|
357
|
+
* @param in_array - The array to be inserted
|
|
357
358
|
*/
|
|
358
359
|
insertRange(in_offset: number, in_array: any[]) {
|
|
359
360
|
this._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));
|
|
@@ -13,6 +13,7 @@ import { constants } from "../constants";
|
|
|
13
13
|
|
|
14
14
|
const BIT32 = 4294967296;
|
|
15
15
|
const { MSG } = constants;
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* A data representation class for 64 bit integer types.
|
|
18
19
|
* This is necessary since js doesn't support 64bit
|
|
@@ -22,22 +23,22 @@ const { MSG } = constants;
|
|
|
22
23
|
* There are and there won't be set functions!
|
|
23
24
|
* (see javascript String class)
|
|
24
25
|
*
|
|
25
|
-
* @param low
|
|
26
|
-
* @param high -
|
|
26
|
+
* @param low - Lower 32 bit
|
|
27
|
+
* @param high - Higher 32 bit
|
|
27
28
|
*/
|
|
28
29
|
export class Integer64 {
|
|
29
30
|
constructor(protected low = 0, protected high = 0) {
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
* @returns
|
|
34
|
+
* @returns The higher 32 bit integer part
|
|
34
35
|
*/
|
|
35
36
|
getValueHigh() {
|
|
36
37
|
return this.high;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
* @returns
|
|
41
|
+
* @returns The lower 32 bit integer part
|
|
41
42
|
*/
|
|
42
43
|
getValueLow() {
|
|
43
44
|
return this.low;
|
|
@@ -73,11 +74,11 @@ export class Integer64 {
|
|
|
73
74
|
* @param in_string - The value to parse. Leading whitespace in the string argument is ignored.
|
|
74
75
|
* @param in_radix - An integer between 2 and 36 that represents the
|
|
75
76
|
* radix (the base in mathematical numeral systems) of the above mentioned string.
|
|
76
|
-
* @throws
|
|
77
|
-
* @throws
|
|
78
|
-
* @throws
|
|
79
|
-
* @throws
|
|
80
|
-
* @returns
|
|
77
|
+
* @throws If in_string is not a string
|
|
78
|
+
* @throws If in_radix is entered but is not a number between 2 and 36
|
|
79
|
+
* @throws If the property is a Uint64 property and in_string is a negative number
|
|
80
|
+
* @throws If in_string contains characters other than numbers
|
|
81
|
+
* @returns Low and high bits of Int64
|
|
81
82
|
*/
|
|
82
83
|
function _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {
|
|
83
84
|
ConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);
|
|
@@ -129,7 +129,7 @@ export class SortedCollection<T> extends Collection<T> {
|
|
|
129
129
|
* For the given list of keys ['1.0.1', '2.0.0', '2.2.0', '7.0.1'] the nearest next item to 6.0.1 is
|
|
130
130
|
* the item mapped by '7.0.1'
|
|
131
131
|
* @param in_key - The key to check against in order to get the nearest next item
|
|
132
|
-
* @returns
|
|
132
|
+
* @returns The nearest next item
|
|
133
133
|
*/
|
|
134
134
|
getNearestNextItem(in_key: string) {
|
|
135
135
|
const closestNextIndex = this._binarySearchNearestIndex(this._sortedKeys, in_key.toString());
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Checks if a flag is set
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @returns
|
|
8
|
+
* @param flags - Flags set within an error object
|
|
9
|
+
* @param flag - A flag to be checked
|
|
10
|
+
* @returns True if the flag is set in passed flags, false otherwise.
|
|
11
11
|
*/
|
|
12
12
|
const _isFlagSet = (flags: number, flag: number) => {
|
|
13
13
|
// eslint-disable-next-line no-bitwise
|
package/src/guidUtils.ts
CHANGED
|
@@ -37,9 +37,8 @@ const guidRNG = {
|
|
|
37
37
|
* local time and Math.random() is used.
|
|
38
38
|
* @param in_enforceReInitialization - Optionally enforce re-initialization with another seed
|
|
39
39
|
*
|
|
40
|
-
* @returns
|
|
41
|
-
*
|
|
42
|
-
* a zero indicates that the RNG was not re-seeded.
|
|
40
|
+
* @returns The seed used to initialize the RNG;
|
|
41
|
+
* If re-initialization is not enforced, a zero indicates that the RNG was not re-seeded.
|
|
43
42
|
* @alias property-common.initializeGUIDGenerator
|
|
44
43
|
*/
|
|
45
44
|
initialize(in_seed?: number, in_enforceReInitialization: boolean = false): number {
|
package/src/packageVersion.ts
CHANGED