@fluid-experimental/property-common 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.216897
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/chronometer.d.ts +1 -0
- package/dist/chronometer.d.ts.map +1 -1
- package/dist/chronometer.js +1 -0
- package/dist/chronometer.js.map +1 -1
- package/dist/consoleUtils.d.ts +1 -0
- package/dist/consoleUtils.d.ts.map +1 -1
- package/dist/consoleUtils.js +1 -0
- package/dist/consoleUtils.js.map +1 -1
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -0
- package/dist/constants.js.map +1 -1
- package/dist/datastructures/collection.d.ts +3 -0
- package/dist/datastructures/collection.d.ts.map +1 -1
- package/dist/datastructures/collection.js +3 -0
- package/dist/datastructures/collection.js.map +1 -1
- package/dist/datastructures/dataArray.d.ts +28 -0
- package/dist/datastructures/dataArray.d.ts.map +1 -1
- package/dist/datastructures/dataArray.js +28 -0
- package/dist/datastructures/dataArray.js.map +1 -1
- package/dist/datastructures/integer64.d.ts +3 -0
- package/dist/datastructures/integer64.d.ts.map +1 -1
- package/dist/datastructures/integer64.js +3 -0
- package/dist/datastructures/integer64.js.map +1 -1
- package/dist/datastructures/sortedCollection.d.ts +3 -0
- package/dist/datastructures/sortedCollection.d.ts.map +1 -1
- package/dist/datastructures/sortedCollection.js +3 -0
- package/dist/datastructures/sortedCollection.js.map +1 -1
- package/dist/deferredPromise.d.ts +1 -0
- package/dist/deferredPromise.d.ts.map +1 -1
- package/dist/deferredPromise.js +1 -0
- package/dist/deferredPromise.js.map +1 -1
- package/dist/deterministicRandomGenerator.d.ts +1 -0
- package/dist/deterministicRandomGenerator.d.ts.map +1 -1
- package/dist/deterministicRandomGenerator.js +1 -0
- package/dist/deterministicRandomGenerator.js.map +1 -1
- package/dist/error_objects/flaggedError.d.ts +3 -0
- package/dist/error_objects/flaggedError.d.ts.map +1 -1
- package/dist/error_objects/flaggedError.js +3 -0
- package/dist/error_objects/flaggedError.js.map +1 -1
- package/dist/error_objects/httpError.d.ts +1 -0
- package/dist/error_objects/httpError.d.ts.map +1 -1
- package/dist/error_objects/httpError.js +1 -0
- package/dist/error_objects/httpError.js.map +1 -1
- package/dist/error_objects/httpErrorNoStack.d.ts +1 -0
- package/dist/error_objects/httpErrorNoStack.d.ts.map +1 -1
- package/dist/error_objects/httpErrorNoStack.js +1 -0
- package/dist/error_objects/httpErrorNoStack.js.map +1 -1
- package/dist/error_objects/operationError.d.ts +3 -0
- package/dist/error_objects/operationError.d.ts.map +1 -1
- package/dist/error_objects/operationError.js +3 -0
- package/dist/error_objects/operationError.js.map +1 -1
- package/dist/guidUtils.d.ts +3 -0
- package/dist/guidUtils.d.ts.map +1 -1
- package/dist/guidUtils.js +3 -0
- package/dist/guidUtils.js.map +1 -1
- package/dist/hashCalculator.d.ts +3 -0
- package/dist/hashCalculator.d.ts.map +1 -1
- package/dist/hashCalculator.js +3 -0
- package/dist/hashCalculator.js.map +1 -1
- package/dist/joinPaths.d.ts +1 -0
- package/dist/joinPaths.d.ts.map +1 -1
- package/dist/joinPaths.js +1 -0
- package/dist/joinPaths.js.map +1 -1
- package/lib/chronometer.d.ts +1 -0
- package/lib/chronometer.d.ts.map +1 -1
- package/lib/chronometer.js +1 -0
- package/lib/chronometer.js.map +1 -1
- package/lib/consoleUtils.d.ts +1 -0
- package/lib/consoleUtils.d.ts.map +1 -1
- package/lib/consoleUtils.js +1 -0
- package/lib/consoleUtils.js.map +1 -1
- package/lib/constants.d.ts +3 -0
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +3 -0
- package/lib/constants.js.map +1 -1
- package/lib/datastructures/collection.d.ts +3 -0
- package/lib/datastructures/collection.d.ts.map +1 -1
- package/lib/datastructures/collection.js +3 -0
- package/lib/datastructures/collection.js.map +1 -1
- package/lib/datastructures/dataArray.d.ts +28 -0
- package/lib/datastructures/dataArray.d.ts.map +1 -1
- package/lib/datastructures/dataArray.js +28 -0
- package/lib/datastructures/dataArray.js.map +1 -1
- package/lib/datastructures/integer64.d.ts +3 -0
- package/lib/datastructures/integer64.d.ts.map +1 -1
- package/lib/datastructures/integer64.js +3 -0
- package/lib/datastructures/integer64.js.map +1 -1
- package/lib/datastructures/sortedCollection.d.ts +3 -0
- package/lib/datastructures/sortedCollection.d.ts.map +1 -1
- package/lib/datastructures/sortedCollection.js +3 -0
- package/lib/datastructures/sortedCollection.js.map +1 -1
- package/lib/deferredPromise.d.ts +1 -0
- package/lib/deferredPromise.d.ts.map +1 -1
- package/lib/deferredPromise.js +1 -0
- package/lib/deferredPromise.js.map +1 -1
- package/lib/deterministicRandomGenerator.d.ts +1 -0
- package/lib/deterministicRandomGenerator.d.ts.map +1 -1
- package/lib/deterministicRandomGenerator.js +1 -0
- package/lib/deterministicRandomGenerator.js.map +1 -1
- package/lib/error_objects/flaggedError.d.ts +3 -0
- package/lib/error_objects/flaggedError.d.ts.map +1 -1
- package/lib/error_objects/flaggedError.js +3 -0
- package/lib/error_objects/flaggedError.js.map +1 -1
- package/lib/error_objects/httpError.d.ts +1 -0
- package/lib/error_objects/httpError.d.ts.map +1 -1
- package/lib/error_objects/httpError.js +1 -0
- package/lib/error_objects/httpError.js.map +1 -1
- package/lib/error_objects/httpErrorNoStack.d.ts +1 -0
- package/lib/error_objects/httpErrorNoStack.d.ts.map +1 -1
- package/lib/error_objects/httpErrorNoStack.js +1 -0
- package/lib/error_objects/httpErrorNoStack.js.map +1 -1
- package/lib/error_objects/operationError.d.ts +3 -0
- package/lib/error_objects/operationError.d.ts.map +1 -1
- package/lib/error_objects/operationError.js +3 -0
- package/lib/error_objects/operationError.js.map +1 -1
- package/lib/guidUtils.d.ts +3 -0
- package/lib/guidUtils.d.ts.map +1 -1
- package/lib/guidUtils.js +3 -0
- package/lib/guidUtils.js.map +1 -1
- package/lib/hashCalculator.d.ts +3 -0
- package/lib/hashCalculator.d.ts.map +1 -1
- package/lib/hashCalculator.js +3 -0
- package/lib/hashCalculator.js.map +1 -1
- package/lib/joinPaths.d.ts +1 -0
- package/lib/joinPaths.d.ts.map +1 -1
- package/lib/joinPaths.js +1 -0
- package/lib/joinPaths.js.map +1 -1
- package/package.json +2 -2
- package/platform-dependent/package.json +1 -1
- package/src/chronometer.ts +1 -0
- package/src/consoleUtils.ts +1 -0
- package/src/constants.ts +3 -0
- package/src/datastructures/collection.ts +3 -0
- package/src/datastructures/dataArray.ts +28 -0
- package/src/datastructures/integer64.ts +3 -0
- package/src/datastructures/sortedCollection.ts +3 -0
- package/src/deferredPromise.ts +1 -0
- package/src/deterministicRandomGenerator.ts +1 -0
- package/src/error_objects/flaggedError.ts +3 -0
- package/src/error_objects/httpError.ts +1 -0
- package/src/error_objects/httpErrorNoStack.ts +1 -0
- package/src/error_objects/operationError.ts +3 -0
- package/src/guidUtils.ts +3 -0
- package/src/hashCalculator.ts +3 -0
- package/src/joinPaths.ts +1 -0
- package/api-extractor.json +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataArray.d.ts","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"dataArray.d.ts","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AAEH;;;;GAIG;AACH,cAAM,aAAa;IAClB,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACnC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM;IAExB;;;OAGG;gBACS,iBAAiB,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM;IAchD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,SAAI,GAAG,GAAG;IAQzB;;;;;OAKG;IACH,aAAa,CAAC,WAAW,EAAE,MAAM,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,aAAc,SAAQ,kBAAkB;IAC7C;;OAEG;gBACS,IAAI,EAAE,MAAM;IAIxB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;OAIG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE;IAM9C;;;;OAIG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,KAAA;CAa/B;AAED,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,CAAC"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* A typed data container that is persistable, high-performance, and can be used
|
|
12
12
|
* as a backing store for collaborative property sets.
|
|
13
|
+
* @internal
|
|
13
14
|
*/
|
|
14
15
|
class BaseDataArray {
|
|
15
16
|
constructor(a, b) {
|
|
@@ -243,41 +244,65 @@ class BaseDataArray {
|
|
|
243
244
|
return this.size;
|
|
244
245
|
}
|
|
245
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* @internal
|
|
249
|
+
*/
|
|
246
250
|
class Int8DataArray extends BaseDataArray {
|
|
247
251
|
constructor(size) {
|
|
248
252
|
super(Int8Array, size);
|
|
249
253
|
}
|
|
250
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
251
258
|
class Int16DataArray extends BaseDataArray {
|
|
252
259
|
constructor(size) {
|
|
253
260
|
super(Int16Array, size);
|
|
254
261
|
}
|
|
255
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* @internal
|
|
265
|
+
*/
|
|
256
266
|
class Int32DataArray extends BaseDataArray {
|
|
257
267
|
constructor(size) {
|
|
258
268
|
super(Int32Array, size);
|
|
259
269
|
}
|
|
260
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* @internal
|
|
273
|
+
*/
|
|
261
274
|
class Uint8DataArray extends BaseDataArray {
|
|
262
275
|
constructor(size) {
|
|
263
276
|
super(Uint8Array, size);
|
|
264
277
|
}
|
|
265
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* @internal
|
|
281
|
+
*/
|
|
266
282
|
class Uint16DataArray extends BaseDataArray {
|
|
267
283
|
constructor(size) {
|
|
268
284
|
super(Uint16Array, size);
|
|
269
285
|
}
|
|
270
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
* @internal
|
|
289
|
+
*/
|
|
271
290
|
class Uint32DataArray extends BaseDataArray {
|
|
272
291
|
constructor(size) {
|
|
273
292
|
super(Uint32Array, size);
|
|
274
293
|
}
|
|
275
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* @internal
|
|
297
|
+
*/
|
|
276
298
|
class Float32DataArray extends BaseDataArray {
|
|
277
299
|
constructor(size) {
|
|
278
300
|
super(Float32Array, size);
|
|
279
301
|
}
|
|
280
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* @internal
|
|
305
|
+
*/
|
|
281
306
|
class Float64DataArray extends BaseDataArray {
|
|
282
307
|
constructor(size) {
|
|
283
308
|
super(Float64Array, size);
|
|
@@ -287,6 +312,7 @@ class Float64DataArray extends BaseDataArray {
|
|
|
287
312
|
* A data container that can contain every native type
|
|
288
313
|
*
|
|
289
314
|
* @param size - The initial size with which to allocate the array.
|
|
315
|
+
* @internal
|
|
290
316
|
*/
|
|
291
317
|
class UniversalDataArray extends BaseDataArray {
|
|
292
318
|
constructor(a, b) {
|
|
@@ -393,6 +419,7 @@ class UniversalDataArray extends BaseDataArray {
|
|
|
393
419
|
}
|
|
394
420
|
/**
|
|
395
421
|
* A data container that contains a string
|
|
422
|
+
* @internal
|
|
396
423
|
*/
|
|
397
424
|
class StringDataArray extends BaseDataArray {
|
|
398
425
|
constructor() {
|
|
@@ -449,6 +476,7 @@ class StringDataArray extends BaseDataArray {
|
|
|
449
476
|
}
|
|
450
477
|
/**
|
|
451
478
|
* A data container that can contain boolean type
|
|
479
|
+
* @internal
|
|
452
480
|
*/
|
|
453
481
|
class BoolDataArray extends UniversalDataArray {
|
|
454
482
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataArray.js","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wDAAwD;AACxD,4DAA4D;AAE5D;;GAEG;AAEH;;;GAGG;AACH,MAAM,aAAa;IAYlB,YAAY,CAAC,EAAE,CAAE;QAChB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YAC1B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;YACd,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;SAC9C;aAAM;YACN,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;SACd;QACD,6DAA6D;QAC7D,mDAAmD;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAM,GAAG,CAAC;QAClB,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,GAAG,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACnD;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,WAAmB,EAAE,SAAiB;QACnD,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS,GAAG,IAAI,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE;YAC1F,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACnD;QAED,OAAO,IAAI,CAAC,OAAO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Y,IAAI,CAAC,aAAa,EAAE,EACvC;YACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;SACrD;aAAM,IAAI,QAAQ,YAAY,aAAa,EAAE;YAC7C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;SACjE;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACpF;IACF,CAAC;CACD;AAED,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n\n/**\n * The data arrays definition file.\n */\n\n/**\n * A typed data container that is persistable, high-performance, and can be used\n * as a backing store for collaborative property sets.\n */\nclass BaseDataArray {\n\tprotected _buffer: any;\n\tprivate readonly bufferConstructor;\n\tprotected size: number;\n\n\tconstructor(size: number);\n\n\t/**\n\t * @param bufferConstructor - This is the constructor to be used to setup the internal buffer of the DataArray.\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(a, b?) {\n\t\tif (typeof a === \"number\") {\n\t\t\tthis.size = a;\n\t\t\tthis.bufferConstructor = this.getBufferCtor();\n\t\t} else {\n\t\t\tthis.bufferConstructor = a;\n\t\t\tthis.size = b;\n\t\t}\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tthis._buffer = new this.bufferConstructor(this.size);\n\t}\n\n\t/**\n\t * Get the value at an index. If no index is passed, return zeroth item.\n\t * @param in_idx - The specific item in the data array.\n\t * @returns The value at that index.\n\t */\n\tgetValue(in_idx = 0): any {\n\t\tif (in_idx >= this.size || in_idx < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer[in_idx];\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer.subarray(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * Return the serialized form of Data Arrays.\n\t * @returns An object containing an array of the values.\n\t */\n\tserialize(): number[] {\n\t\treturn Array.from(this._buffer.subarray(0, this.size));\n\t}\n\n\t/**\n\t * Deserialize data from a serialized representation\n\t * @param in_serialized - the serialized representation\n\t */\n\tdeserialize(in_serialized) {\n\t\tconst values = in_serialized;\n\t\tconst length = in_serialized.length;\n\t\tif (length !== this.size) {\n\t\t\tthis.resize(length);\n\t\t\tthis.size = length;\n\t\t}\n\t\tlet i;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis._buffer[i] = values[i];\n\t\t}\n\t}\n\n\t/**\n\t * Set value at an index.\n\t * @param in_idx - the index\n\t * @param in_value - the value we want to set at index\n\t */\n\tsetValue(in_idx: number, in_value) {\n\t\tif (in_idx < this._buffer.length) {\n\t\t\tthis._buffer[in_idx] = in_value;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray setValue in_idx is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * creates a copy of a typed array with removed elements\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - starting index of range that will be removed\n\t * @param in_deleteCount - number of removed elements\n\t * @returns a copy of the input array without the selected range\n\t */\n\tprivate _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size - in_deleteCount;\n\t\tconst splicedArray = new in_arr.constructor(newSize);\n\t\tsplicedArray.set(in_arr.subarray(0, in_offset));\n\t\tsplicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n\t\treturn splicedArray;\n\t}\n\n\t/**\n\t * remove a range of elements from the array\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n\t\t\tthis.size = this.size - in_deleteCount;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * copy an array with elements inserted into the copy\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - the index where the new elements will be inserted\n\t * @param in_addedArray - the array with the elements that will be added\n\t * @returns the combined array\n\t */\n\tprivate _insert(in_arr, in_offset: number, in_addedArray) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size + (in_addedArray.length as number);\n\t\tconst insertedArray = new in_arr.constructor(newSize);\n\t\tinsertedArray.set(in_arr.subarray(0, in_offset));\n\t\tinsertedArray.set(in_addedArray, in_offset);\n\t\tinsertedArray.set(\n\t\t\tin_arr.subarray(in_offset, this.size),\n\t\t\tin_offset + (in_addedArray.length as number),\n\t\t);\n\t\treturn insertedArray;\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array) {\n\t\tthis._buffer = this._insert(this._buffer, in_offset, in_array);\n\t\tthis.size = this.size + (in_array.length as number);\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis._buffer.set(in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis._buffer.set(in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Insert a value at the end of the array, creates a new element at the end and sets the value.\n\t * @param in_value - The new value.\n\t */\n\tpush(in_value) {\n\t\t// Adjust the buffer if necessary\n\t\tconst bufferLength = this._buffer.length;\n\t\tif (this.size > bufferLength - 1) {\n\t\t\tthis._alloc(this.size * 2 || 1); // grow by a factor of 2x\n\t\t}\n\t\t// set the value and update size\n\t\tthis.setValue(this.size, in_value);\n\t\tthis.size++;\n\t}\n\n\t/**\n\t * Get direct access to the data (for performance reasons) this should be uses read only.\n\t * @returns The (read only) raw data.\n\t */\n\tgetBuffer() {\n\t\treturn this._buffer;\n\t}\n\n\t/**\n\t * Get the constructor of the underlying `TypedArray`.\n\t * @returns The constructor for the data buffer.\n\t */\n\tgetBufferCtor() {\n\t\treturn this.bufferConstructor;\n\t}\n\n\t/**\n\t * Apply a given function to all elements of the array.\n\t * @param in_fn - The function that will be applied to every element.\n\t */\n\titerate(in_fn) {\n\t\tconst l = this.size;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tin_fn(this._buffer[i]);\n\t\t}\n\t}\n\n\t/**\n\t * Tet a resized buffer copy.\n\t * @param in_bufferCtor - The constructor for the returned buffer.\n\t * @param in_buffer - The input buffer (won't be modified).\n\t * @param in_newSize - The target size.\n\t * @returns The buffer with the new size.\n\t */\n\tprivate resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n\t\t// target buffer with the desired new size\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tconst newBuffer = new in_bufferCtor(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tnewBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * Allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later).\n\t * @param size - The target allocated space.\n\t * @returns The DataArray itself.\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Change the size of the array\n\t * @param size - The target size\n\t * @returns The DataArray itself\n\t */\n\tresize(size: number) {\n\t\t// this can be costly!!!\n\t\tthis._alloc(size);\n\t\tthis.size = size;\n\t\treturn this;\n\t}\n\n\tcopy() {\n\t\t// and this!\n\t\tconst newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n\t\tnewBuffer.set(this._buffer);\n\t\treturn newBuffer;\n\t}\n\n\tget length() {\n\t\treturn this.size;\n\t}\n}\n\nclass Int8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int8Array, size);\n\t}\n}\n\nclass Int16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int16Array, size);\n\t}\n}\n\nclass Int32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int32Array, size);\n\t}\n}\n\nclass Uint8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint8Array, size);\n\t}\n}\n\nclass Uint16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint16Array, size);\n\t}\n}\n\nclass Uint32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint32Array, size);\n\t}\n}\n\nclass Float32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float32Array, size);\n\t}\n}\n\nclass Float64DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float64Array, size);\n\t}\n}\n\n/**\n * A data container that can contain every native type\n *\n * @param size - The initial size with which to allocate the array.\n */\nclass UniversalDataArray extends BaseDataArray {\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(size: number);\n\tconstructor(a?, b?) {\n\t\tif (b === undefined) {\n\t\t\tsuper(Array, a);\n\t\t} else {\n\t\t\tsuper(a, b);\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to write array values into another array at a given offset.\n\t *\n\t * @param array - The target array.\n\t * @param values - The values we need to write.\n\t * @param offset - The starting index in target array.\n\t */\n\tprivate arraySet(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = value;\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * Insert the content of an array into the DataArray.\n\t * @param in_offset - The target index.\n\t * @param in_array - The array to be inserted.\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Eemove a range of elements from the array.\n\t * @param in_offset - The start of the range.\n\t * @param in_deleteCount - The number of elements to be removed.\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer.splice(in_offset, in_deleteCount);\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start\n\t * setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySet(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n\t * @param in_buffer - input buffer - not changed\n\t * @param in_newSize - target size\n\t * @returns an Array of the new size\n\t */\n\tprivate resizeBufferArray(in_buffer, in_newSize) {\n\t\t// target buffer with the desired new size\n\t\tconst newBuffer = new Array(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tthis.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later)\n\t * @param size - the target allocated space\n\t * @returns the DataArray itself\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBufferArray(this._buffer, size);\n\t\treturn this;\n\t}\n}\n\n/**\n * A data container that contains a string\n */\nclass StringDataArray extends BaseDataArray {\n\tconstructor() {\n\t\tsuper(String, 0);\n\t\tthis.size = 0;\n\t\tthis._buffer = \"\";\n\t}\n\t/**\n\t * insert the content of a string into the StringDataArray\n\t * @param in_offset - the target index\n\t * @param in_string - the string to be inserted\n\t */\n\tinsertRange(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset,\n\t\t)}`;\n\t\tthis.size = this.size + in_string.length;\n\t}\n\n\t/**\n\t * remove a range of elements from the string\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(\n\t\t\t\tin_offset + in_deleteCount,\n\t\t\t)}`;\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_string values.\n\t * @param in_offset - The offset in this array to begin start setting this arrays values to in_string values.\n\t * @param in_string - The input string.\n\t */\n\tset(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset + in_string.length,\n\t\t)}`;\n\t}\n\n\t/**\n\t * Return a range of characters in the string.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the characters in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number): string {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\tget length() {\n\t\treturn this._buffer.length;\n\t}\n}\n\n/**\n * A data container that can contain boolean type\n */\nclass BoolDataArray extends UniversalDataArray {\n\t/**\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(size: number) {\n\t\tsuper(Array, size);\n\t}\n\n\t/**\n\t * helper function to write and cast to boolean array values into another array at a given offset\n\t * @param array - target array\n\t * @param values - the values we need to write\n\t * @param offset - starting index in target array\n\t */\n\tprivate arraySetBool(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = !!(value as boolean);\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tconst toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(toBeAdded));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySetBool(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n}\n\nexport {\n\tBaseDataArray,\n\tFloat32DataArray,\n\tFloat64DataArray,\n\tInt8DataArray,\n\tInt16DataArray,\n\tInt32DataArray,\n\tUint8DataArray,\n\tUint16DataArray,\n\tUint32DataArray,\n\tUniversalDataArray,\n\tStringDataArray,\n\tBoolDataArray,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"dataArray.js","sourceRoot":"","sources":["../../src/datastructures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E,QAAQ,EAAE,SAAS,CAAC,CAAC;SACrD;aAAM,IAAI,QAAQ,YAAY,aAAa,EAAE;YAC7C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;SACjE;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACpF;IACF,CAAC;CACD;AAED,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n\n/**\n * The data arrays definition file.\n */\n\n/**\n * A typed data container that is persistable, high-performance, and can be used\n * as a backing store for collaborative property sets.\n * @internal\n */\nclass BaseDataArray {\n\tprotected _buffer: any;\n\tprivate readonly bufferConstructor;\n\tprotected size: number;\n\n\tconstructor(size: number);\n\n\t/**\n\t * @param bufferConstructor - This is the constructor to be used to setup the internal buffer of the DataArray.\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(a, b?) {\n\t\tif (typeof a === \"number\") {\n\t\t\tthis.size = a;\n\t\t\tthis.bufferConstructor = this.getBufferCtor();\n\t\t} else {\n\t\t\tthis.bufferConstructor = a;\n\t\t\tthis.size = b;\n\t\t}\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tthis._buffer = new this.bufferConstructor(this.size);\n\t}\n\n\t/**\n\t * Get the value at an index. If no index is passed, return zeroth item.\n\t * @param in_idx - The specific item in the data array.\n\t * @returns The value at that index.\n\t */\n\tgetValue(in_idx = 0): any {\n\t\tif (in_idx >= this.size || in_idx < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer[in_idx];\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer.subarray(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * Return the serialized form of Data Arrays.\n\t * @returns An object containing an array of the values.\n\t */\n\tserialize(): number[] {\n\t\treturn Array.from(this._buffer.subarray(0, this.size));\n\t}\n\n\t/**\n\t * Deserialize data from a serialized representation\n\t * @param in_serialized - the serialized representation\n\t */\n\tdeserialize(in_serialized) {\n\t\tconst values = in_serialized;\n\t\tconst length = in_serialized.length;\n\t\tif (length !== this.size) {\n\t\t\tthis.resize(length);\n\t\t\tthis.size = length;\n\t\t}\n\t\tlet i;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis._buffer[i] = values[i];\n\t\t}\n\t}\n\n\t/**\n\t * Set value at an index.\n\t * @param in_idx - the index\n\t * @param in_value - the value we want to set at index\n\t */\n\tsetValue(in_idx: number, in_value) {\n\t\tif (in_idx < this._buffer.length) {\n\t\t\tthis._buffer[in_idx] = in_value;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray setValue in_idx is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * creates a copy of a typed array with removed elements\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - starting index of range that will be removed\n\t * @param in_deleteCount - number of removed elements\n\t * @returns a copy of the input array without the selected range\n\t */\n\tprivate _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size - in_deleteCount;\n\t\tconst splicedArray = new in_arr.constructor(newSize);\n\t\tsplicedArray.set(in_arr.subarray(0, in_offset));\n\t\tsplicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n\t\treturn splicedArray;\n\t}\n\n\t/**\n\t * remove a range of elements from the array\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n\t\t\tthis.size = this.size - in_deleteCount;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * copy an array with elements inserted into the copy\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - the index where the new elements will be inserted\n\t * @param in_addedArray - the array with the elements that will be added\n\t * @returns the combined array\n\t */\n\tprivate _insert(in_arr, in_offset: number, in_addedArray) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size + (in_addedArray.length as number);\n\t\tconst insertedArray = new in_arr.constructor(newSize);\n\t\tinsertedArray.set(in_arr.subarray(0, in_offset));\n\t\tinsertedArray.set(in_addedArray, in_offset);\n\t\tinsertedArray.set(\n\t\t\tin_arr.subarray(in_offset, this.size),\n\t\t\tin_offset + (in_addedArray.length as number),\n\t\t);\n\t\treturn insertedArray;\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array) {\n\t\tthis._buffer = this._insert(this._buffer, in_offset, in_array);\n\t\tthis.size = this.size + (in_array.length as number);\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis._buffer.set(in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis._buffer.set(in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Insert a value at the end of the array, creates a new element at the end and sets the value.\n\t * @param in_value - The new value.\n\t */\n\tpush(in_value) {\n\t\t// Adjust the buffer if necessary\n\t\tconst bufferLength = this._buffer.length;\n\t\tif (this.size > bufferLength - 1) {\n\t\t\tthis._alloc(this.size * 2 || 1); // grow by a factor of 2x\n\t\t}\n\t\t// set the value and update size\n\t\tthis.setValue(this.size, in_value);\n\t\tthis.size++;\n\t}\n\n\t/**\n\t * Get direct access to the data (for performance reasons) this should be uses read only.\n\t * @returns The (read only) raw data.\n\t */\n\tgetBuffer() {\n\t\treturn this._buffer;\n\t}\n\n\t/**\n\t * Get the constructor of the underlying `TypedArray`.\n\t * @returns The constructor for the data buffer.\n\t */\n\tgetBufferCtor() {\n\t\treturn this.bufferConstructor;\n\t}\n\n\t/**\n\t * Apply a given function to all elements of the array.\n\t * @param in_fn - The function that will be applied to every element.\n\t */\n\titerate(in_fn) {\n\t\tconst l = this.size;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tin_fn(this._buffer[i]);\n\t\t}\n\t}\n\n\t/**\n\t * Tet a resized buffer copy.\n\t * @param in_bufferCtor - The constructor for the returned buffer.\n\t * @param in_buffer - The input buffer (won't be modified).\n\t * @param in_newSize - The target size.\n\t * @returns The buffer with the new size.\n\t */\n\tprivate resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n\t\t// target buffer with the desired new size\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tconst newBuffer = new in_bufferCtor(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tnewBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * Allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later).\n\t * @param size - The target allocated space.\n\t * @returns The DataArray itself.\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Change the size of the array\n\t * @param size - The target size\n\t * @returns The DataArray itself\n\t */\n\tresize(size: number) {\n\t\t// this can be costly!!!\n\t\tthis._alloc(size);\n\t\tthis.size = size;\n\t\treturn this;\n\t}\n\n\tcopy() {\n\t\t// and this!\n\t\tconst newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n\t\tnewBuffer.set(this._buffer);\n\t\treturn newBuffer;\n\t}\n\n\tget length() {\n\t\treturn this.size;\n\t}\n}\n\n/**\n * @internal\n */\nclass Int8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int8Array, size);\n\t}\n}\n\n/**\n * @internal\n */\nclass Int16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int16Array, size);\n\t}\n}\n\n/**\n * @internal\n */\nclass Int32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int32Array, size);\n\t}\n}\n\n/**\n * @internal\n */\nclass Uint8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint8Array, size);\n\t}\n}\n\n/**\n * @internal\n */\nclass Uint16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint16Array, size);\n\t}\n}\n\n/**\n * @internal\n */\nclass Uint32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint32Array, size);\n\t}\n}\n\n/**\n * @internal\n */\nclass Float32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float32Array, size);\n\t}\n}\n\n/**\n * @internal\n */\nclass Float64DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float64Array, size);\n\t}\n}\n\n/**\n * A data container that can contain every native type\n *\n * @param size - The initial size with which to allocate the array.\n * @internal\n */\nclass UniversalDataArray extends BaseDataArray {\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(size: number);\n\tconstructor(a?, b?) {\n\t\tif (b === undefined) {\n\t\t\tsuper(Array, a);\n\t\t} else {\n\t\t\tsuper(a, b);\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to write array values into another array at a given offset.\n\t *\n\t * @param array - The target array.\n\t * @param values - The values we need to write.\n\t * @param offset - The starting index in target array.\n\t */\n\tprivate arraySet(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = value;\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * Insert the content of an array into the DataArray.\n\t * @param in_offset - The target index.\n\t * @param in_array - The array to be inserted.\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Eemove a range of elements from the array.\n\t * @param in_offset - The start of the range.\n\t * @param in_deleteCount - The number of elements to be removed.\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer.splice(in_offset, in_deleteCount);\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start\n\t * setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySet(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n\t * @param in_buffer - input buffer - not changed\n\t * @param in_newSize - target size\n\t * @returns an Array of the new size\n\t */\n\tprivate resizeBufferArray(in_buffer, in_newSize) {\n\t\t// target buffer with the desired new size\n\t\tconst newBuffer = new Array(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tthis.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later)\n\t * @param size - the target allocated space\n\t * @returns the DataArray itself\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBufferArray(this._buffer, size);\n\t\treturn this;\n\t}\n}\n\n/**\n * A data container that contains a string\n * @internal\n */\nclass StringDataArray extends BaseDataArray {\n\tconstructor() {\n\t\tsuper(String, 0);\n\t\tthis.size = 0;\n\t\tthis._buffer = \"\";\n\t}\n\t/**\n\t * insert the content of a string into the StringDataArray\n\t * @param in_offset - the target index\n\t * @param in_string - the string to be inserted\n\t */\n\tinsertRange(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset,\n\t\t)}`;\n\t\tthis.size = this.size + in_string.length;\n\t}\n\n\t/**\n\t * remove a range of elements from the string\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(\n\t\t\t\tin_offset + in_deleteCount,\n\t\t\t)}`;\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_string values.\n\t * @param in_offset - The offset in this array to begin start setting this arrays values to in_string values.\n\t * @param in_string - The input string.\n\t */\n\tset(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset + in_string.length,\n\t\t)}`;\n\t}\n\n\t/**\n\t * Return a range of characters in the string.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the characters in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number): string {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\tget length() {\n\t\treturn this._buffer.length;\n\t}\n}\n\n/**\n * A data container that can contain boolean type\n * @internal\n */\nclass BoolDataArray extends UniversalDataArray {\n\t/**\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(size: number) {\n\t\tsuper(Array, size);\n\t}\n\n\t/**\n\t * helper function to write and cast to boolean array values into another array at a given offset\n\t * @param array - target array\n\t * @param values - the values we need to write\n\t * @param offset - starting index in target array\n\t */\n\tprivate arraySetBool(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = !!(value as boolean);\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tconst toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(toBeAdded));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySetBool(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n}\n\nexport {\n\tBaseDataArray,\n\tFloat32DataArray,\n\tFloat64DataArray,\n\tInt8DataArray,\n\tInt16DataArray,\n\tInt32DataArray,\n\tUint8DataArray,\n\tUint16DataArray,\n\tUint32DataArray,\n\tUniversalDataArray,\n\tStringDataArray,\n\tBoolDataArray,\n};\n"]}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @param low - Lower 32 bit
|
|
14
14
|
* @param high - Higher 32 bit
|
|
15
|
+
* @internal
|
|
15
16
|
*/
|
|
16
17
|
export declare class Integer64 {
|
|
17
18
|
protected low: number;
|
|
@@ -29,6 +30,7 @@ export declare class Integer64 {
|
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* A data representation class for the signed 64 bit integer type
|
|
33
|
+
* @internal
|
|
32
34
|
*/
|
|
33
35
|
export declare class Int64 extends Integer64 {
|
|
34
36
|
static fromString: (in_string: string, radix?: number) => Int64;
|
|
@@ -37,6 +39,7 @@ export declare class Int64 extends Integer64 {
|
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* A data representation class for the unsigned 64 bit integer type
|
|
42
|
+
* @internal
|
|
40
43
|
*/
|
|
41
44
|
export declare class Uint64 extends Integer64 {
|
|
42
45
|
static fromString(in_string: string, in_radix?: number): Uint64;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH
|
|
1
|
+
{"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IAEpB,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,IAAI;gBADJ,GAAG,SAAI,EACP,IAAI,SAAI;IAGnB;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;;GAGG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,cAAwB,MAAM,2BAG7C;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGnB;AAED;;;GAGG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGd"}
|
|
@@ -20,6 +20,7 @@ const { MSG } = constants;
|
|
|
20
20
|
*
|
|
21
21
|
* @param low - Lower 32 bit
|
|
22
22
|
* @param high - Higher 32 bit
|
|
23
|
+
* @internal
|
|
23
24
|
*/
|
|
24
25
|
export class Integer64 {
|
|
25
26
|
constructor(low = 0, high = 0) {
|
|
@@ -110,6 +111,7 @@ function _stringToInt64(in_signed, in_string, in_radix = 10) {
|
|
|
110
111
|
}
|
|
111
112
|
/**
|
|
112
113
|
* A data representation class for the signed 64 bit integer type
|
|
114
|
+
* @internal
|
|
113
115
|
*/
|
|
114
116
|
export class Int64 extends Integer64 {
|
|
115
117
|
clone() {
|
|
@@ -125,6 +127,7 @@ Int64.fromString = function (in_string, radix = 10) {
|
|
|
125
127
|
};
|
|
126
128
|
/**
|
|
127
129
|
* A data representation class for the unsigned 64 bit integer type
|
|
130
|
+
* @internal
|
|
128
131
|
*/
|
|
129
132
|
export class Uint64 extends Integer64 {
|
|
130
133
|
static fromString(in_string, in_radix = 10) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B
|
|
1
|
+
{"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/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AE;IAC1D,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAWH;;;GAGG;AACH,MAAM,OAAO,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAiB,EAAE,QAAQ,GAAG,EAAE;QACjD,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC1E,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,KAAK;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview implements (U)Int64 Datastructures\n */\n\nimport _ from \"lodash\";\nimport { ConsoleUtils } from \"../consoleUtils\";\nimport { constants } from \"../constants\";\n\nconst BIT32 = 4294967296;\nconst { MSG } = constants;\n\n/**\n * A data representation class for 64 bit integer types.\n *\n * @remarks This is necessary since js doesn't support 64bit integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions! (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n * @internal\n */\nexport class Integer64 {\n\tconstructor(\n\t\tprotected low = 0,\n\t\tprotected high = 0,\n\t) {}\n\n\t/**\n\t * @returns The higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this.high;\n\t}\n\n\t/**\n\t * @returns The lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this.low;\n\t}\n\n\tprotected _int64toString(isSigned: boolean, in_radix = 10): string {\n\t\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n\t\tConsoleUtils.assert(\n\t\t\tin_radix >= 2 && 36 >= in_radix,\n\t\t\t`${MSG.BASE_OUT_OF_RANGE} ${in_radix}`,\n\t\t);\n\n\t\tlet high = this.getValueHigh();\n\t\tlet low = this.getValueLow();\n\t\tlet result = \"\";\n\t\tconst sign = !!(isSigned && high & 0x80000000); // eslint-disable-line no-bitwise\n\t\tif (sign) {\n\t\t\thigh = ~high; // eslint-disable-line no-bitwise\n\t\t\tlow = BIT32 - low;\n\t\t}\n\t\tdo {\n\t\t\tconst mod = (high % in_radix) * BIT32 + low;\n\t\t\thigh = Math.floor(high / in_radix);\n\t\t\tlow = Math.floor(mod / in_radix);\n\t\t\tresult = (mod % in_radix).toString(in_radix) + result;\n\t\t} while (high || low);\n\n\t\treturn sign ? `-${result}` : result;\n\t}\n}\n\n/**\n * stringToInt function parses a string argument updates object's lower and higher 32 bit integer parts.\n *\n * @param in_signed - If the expect response should be signed or unsigned.\n * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.\n * @param in_radix - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above mentioned string.\n *\n * @throws If `in_string` is not a string.\n * @throws If `in_radix` is entered but is not a number between 2 and 36.\n * @throws If the property is a `Uint64` property and `in_string` is a negative number.\n * @throws If `in_string` contains characters other than numbers.\n *\n * @returns Low and high bits of `Int64`.\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\tconst string = in_string.trim();\n\n\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n\tConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n\tlet position = 0;\n\tlet negative = false;\n\tlet high = 0;\n\tlet low = 0;\n\tif (string.startsWith(\"-\")) {\n\t\tnegative = true;\n\t\tposition += 1;\n\t}\n\n\tConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n\twhile (position < string.length) {\n\t\tconst digit = parseInt(string[position++], in_radix);\n\t\tif (isNaN(digit)) {\n\t\t\tthrow new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n\t\t}\n\t\tlow = low * in_radix + digit;\n\t\thigh = high * in_radix + Math.floor(low / BIT32);\n\t\tlow %= BIT32;\n\t}\n\n\tif (negative) {\n\t\t// eslint-disable-next-line no-bitwise\n\t\thigh = ~high;\n\t\tif (low) {\n\t\t\tlow = BIT32 - low;\n\t\t} else {\n\t\t\thigh += 1;\n\t\t}\n\t}\n\n\treturn [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n * @internal\n */\nexport class Int64 extends Integer64 {\n\tstatic fromString = function (in_string: string, radix = 10) {\n\t\tconst [low, high] = _stringToInt64(true, in_string, radix);\n\t\treturn new Int64(low, high);\n\t};\n\n\tclone() {\n\t\treturn new Int64(this.low, this.high);\n\t}\n\n\ttoString(radix = 10) {\n\t\treturn this._int64toString(true, radix);\n\t}\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n * @internal\n */\nexport class Uint64 extends Integer64 {\n\tstatic fromString(in_string: string, in_radix = 10) {\n\t\tconst [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n\t\treturn new Uint64(low, high);\n\t}\n\n\tclone() {\n\t\treturn new Uint64(this.low, this.high);\n\t}\n\n\ttoString(radix) {\n\t\treturn this._int64toString(false, radix);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortedCollection.d.ts","sourceRoot":"","sources":["../../src/datastructures/sortedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,mBAAmB,CAAC,CAA+C;IAE3E;;;;;;OAMG;gBACS,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAA;IAItC;;;;;;;;;;;OAWG;IACH,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM;IAK9D;;;;;;;OAOG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC;IASxC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM;IAMrB;;;OAGG;IACH,KAAK,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAO5B;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;IAqCjC;;;;;;OAMG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM;IAUjC;;;;;;OAMG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAS9C"}
|
|
1
|
+
{"version":3,"file":"sortedCollection.d.ts","sourceRoot":"","sources":["../../src/datastructures/sortedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,mBAAmB,CAAC,CAA+C;IAE3E;;;;;;OAMG;gBACS,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAA;IAItC;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oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview\n * Declaration of the SortedCollection class\n */\n\nimport _ from \"lodash\";\nimport { Collection } from \"./collection\";\n\nexport class SortedCollection<T> extends Collection<T> {\n\tprivate _sortedKeys: string[] = [];\n\tprivate _comparisonFunction?: (x: string, y: string) => number = undefined;\n\n\t/**\n\t * A sorted collection class.\n\t * @param in_name - a friendly name to describe this collection. If undefined\n\t * the collection will have a default \"Untitled Collection\" assigned to its name.\n\t * @param in_type - optional parameter pointing to the constructor\n\t * of a type this Collection will host.\n\t */\n\tconstructor(in_name?: string, in_type?) {\n\t\tsuper(in_name, in_type);\n\t}\n\n\t/**\n\t * Set the comparison function. By default the keys will be sorted wrt their ASCII code.\n\t *\n\t * @param in_fn - The function to compare two entries.\n\t * The return value of this function must convey to the following cases:\n\t *\n\t * - if a \\> b, then the return value must be greater than 0.\n\t *\n\t * - if a \\< b, then the return value must be less than 0.\n\t *\n\t * - if a == b, then the return value must be 0.\n\t */\n\tsetComparisonFunction(in_fn?: (x: string, y: string) => number) {\n\t\tconsole.assert(_.isFunction(in_fn), \"Must provide a function\");\n\t\tthis._comparisonFunction = in_fn;\n\t}\n\n\t/**\n\t * Add an item to the collection. Sort the list of keys in an ascending order.\n\t *\n\t * @param in_key - Key to store the value under.\n\t * @param in_value - Value to store in the collection.\n\t *\n\t * @returns The value passed in.\n\t */\n\tadd(in_key: string | number, in_value: T) {\n\t\tconst toReturn = super.add(in_key, in_value);\n\n\t\tthis._sortedKeys.push(in_key.toString());\n\t\tthis._sortedKeys.sort(this._comparisonFunction);\n\n\t\treturn toReturn;\n\t}\n\n\t/**\n\t * Remove an item from this Collection. This method returns a Boolean indicating\n\t * the success or failure of the removal. This is practical because if we were\n\t * to throw an error when the key doesn't exist, it would require additional\n\t * checks by the caller to make sure this key exists prior to removal. Which\n\t * would make the attempt of removal more verbose and also costly because the\n\t * caller would have to keep a list – somewhere else – of the things he can\n\t * and cannot remove.\n\t *\n\t * @param in_key - the key we wish to remove\n\t * @returns true if the key exists and was removed, false otherwise.\n\t */\n\tremove(in_key: string) {\n\t\tconst toReturn = super.remove(in_key);\n\t\tthis._sortedKeys = _.without(this._sortedKeys, in_key);\n\t\treturn toReturn;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @returns cloned SortedCollection\n\t */\n\tclone(): SortedCollection<T> {\n\t\tconst newCol = new SortedCollection<T>(this._name, this._type);\n\t\tnewCol.setComparisonFunction(this._comparisonFunction);\n\t\tnewCol.bulkAdd(this._items);\n\t\treturn newCol;\n\t}\n\n\t/**\n\t * Internal function use to search (binary search) for the nearest index that\n\t * the given key would be inserted.\n\t * i.e. given the array [10, 20, 30, 40, 50] the index that 35 should be inserted at is 3\n\t * @param in_array - Target array\n\t * @param in_key - Key to check against\n\t * @returns The index at which the key would be inserted in\n\t */\n\tprivate _binarySearchNearestIndex(in_array: string[], in_key: string): number {\n\t\tif (this._comparisonFunction === undefined) {\n\t\t\treturn _.sortedIndex(in_array, in_key);\n\t\t} else {\n\t\t\tconst middleIndex = Math.floor((in_array.length - 1) / 2);\n\n\t\t\tif (middleIndex < 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (this._comparisonFunction(in_array[middleIndex], in_key) > 0) {\n\t\t\t\tif (in_array.length === 1) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn this._binarySearchNearestIndex(in_array.slice(0, middleIndex), in_key);\n\t\t\t}\n\n\t\t\tif (this._comparisonFunction(in_array[middleIndex], in_key) < 0) {\n\t\t\t\tif (in_array.length === 1) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tmiddleIndex +\n\t\t\t\t\t1 +\n\t\t\t\t\tthis._binarySearchNearestIndex(\n\t\t\t\t\t\tin_array.slice(middleIndex + 1, in_array.length),\n\t\t\t\t\t\tin_key,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn middleIndex;\n\t\t}\n\t}\n\n\t/**\n\t * Return the nearest next item to the given key i.e.\n\t * 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\n\t * the item mapped by '7.0.1'\n\t * @param in_key - The key to check against in order to get the nearest next item\n\t * @returns The nearest next item\n\t */\n\tgetNearestNextItem(in_key: string) {\n\t\tconst closestNextIndex = this._binarySearchNearestIndex(\n\t\t\tthis._sortedKeys,\n\t\t\tin_key.toString(),\n\t\t);\n\t\treturn closestNextIndex === this.getCount()\n\t\t\t? undefined\n\t\t\t: this.item(this._sortedKeys[closestNextIndex]);\n\t}\n\n\t/**\n\t * Return the nearest previous item to the given key i.e.\n\t * For the given list of keys ['1.0.1', '2.0.0', '2.2.0', '7.0.1'] the nearest previous item to 6.0.1 is\n\t * the item mapped by '7.0.1'\n\t * @param in_key - The key to check against in order to get the nearest previous item\n\t * @returns The nearest previous item\n\t */\n\tgetNearestPreviousItem(in_key: string | number) {\n\t\tconst closestPreviousIndex = this._binarySearchNearestIndex(\n\t\t\tthis._sortedKeys,\n\t\t\tin_key.toString(),\n\t\t);\n\t\treturn closestPreviousIndex === 0\n\t\t\t? undefined\n\t\t\t: this.item(this._sortedKeys[closestPreviousIndex - 1]);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sortedCollection.js","sourceRoot":"","sources":["../../src/datastructures/sortedCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,gBAAoB,SAAQ,UAAa;IAIrD;;;;;;OAMG;IACH,YAAY,OAAgB,EAAE,OAAQ;QACrC,KAAK,CAAC,OAAO,EAAE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,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,sBAAsB,CAAC,MAAuB;QAC7C,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,CAC1D,IAAI,CAAC,WAAW,EAChB,MAAM,CAAC,QAAQ,EAAE,CACjB,CAAC;QACF,OAAO,oBAAoB,KAAK,CAAC;YAChC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview\n * Declaration of the SortedCollection class\n */\n\nimport _ from \"lodash\";\nimport { Collection } from \"./collection\";\n\n/**\n * @internal\n */\nexport class SortedCollection<T> extends Collection<T> {\n\tprivate _sortedKeys: string[] = [];\n\tprivate _comparisonFunction?: (x: string, y: string) => number = undefined;\n\n\t/**\n\t * A sorted collection class.\n\t * @param in_name - a friendly name to describe this collection. If undefined\n\t * the collection will have a default \"Untitled Collection\" assigned to its name.\n\t * @param in_type - optional parameter pointing to the constructor\n\t * of a type this Collection will host.\n\t */\n\tconstructor(in_name?: string, in_type?) {\n\t\tsuper(in_name, in_type);\n\t}\n\n\t/**\n\t * Set the comparison function. By default the keys will be sorted wrt their ASCII code.\n\t *\n\t * @param in_fn - The function to compare two entries.\n\t * The return value of this function must convey to the following cases:\n\t *\n\t * - if a \\> b, then the return value must be greater than 0.\n\t *\n\t * - if a \\< b, then the return value must be less than 0.\n\t *\n\t * - if a == b, then the return value must be 0.\n\t */\n\tsetComparisonFunction(in_fn?: (x: string, y: string) => number) {\n\t\tconsole.assert(_.isFunction(in_fn), \"Must provide a function\");\n\t\tthis._comparisonFunction = in_fn;\n\t}\n\n\t/**\n\t * Add an item to the collection. Sort the list of keys in an ascending order.\n\t *\n\t * @param in_key - Key to store the value under.\n\t * @param in_value - Value to store in the collection.\n\t *\n\t * @returns The value passed in.\n\t */\n\tadd(in_key: string | number, in_value: T) {\n\t\tconst toReturn = super.add(in_key, in_value);\n\n\t\tthis._sortedKeys.push(in_key.toString());\n\t\tthis._sortedKeys.sort(this._comparisonFunction);\n\n\t\treturn toReturn;\n\t}\n\n\t/**\n\t * Remove an item from this Collection. This method returns a Boolean indicating\n\t * the success or failure of the removal. This is practical because if we were\n\t * to throw an error when the key doesn't exist, it would require additional\n\t * checks by the caller to make sure this key exists prior to removal. Which\n\t * would make the attempt of removal more verbose and also costly because the\n\t * caller would have to keep a list – somewhere else – of the things he can\n\t * and cannot remove.\n\t *\n\t * @param in_key - the key we wish to remove\n\t * @returns true if the key exists and was removed, false otherwise.\n\t */\n\tremove(in_key: string) {\n\t\tconst toReturn = super.remove(in_key);\n\t\tthis._sortedKeys = _.without(this._sortedKeys, in_key);\n\t\treturn toReturn;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @returns cloned SortedCollection\n\t */\n\tclone(): SortedCollection<T> {\n\t\tconst newCol = new SortedCollection<T>(this._name, this._type);\n\t\tnewCol.setComparisonFunction(this._comparisonFunction);\n\t\tnewCol.bulkAdd(this._items);\n\t\treturn newCol;\n\t}\n\n\t/**\n\t * Internal function use to search (binary search) for the nearest index that\n\t * the given key would be inserted.\n\t * i.e. given the array [10, 20, 30, 40, 50] the index that 35 should be inserted at is 3\n\t * @param in_array - Target array\n\t * @param in_key - Key to check against\n\t * @returns The index at which the key would be inserted in\n\t */\n\tprivate _binarySearchNearestIndex(in_array: string[], in_key: string): number {\n\t\tif (this._comparisonFunction === undefined) {\n\t\t\treturn _.sortedIndex(in_array, in_key);\n\t\t} else {\n\t\t\tconst middleIndex = Math.floor((in_array.length - 1) / 2);\n\n\t\t\tif (middleIndex < 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (this._comparisonFunction(in_array[middleIndex], in_key) > 0) {\n\t\t\t\tif (in_array.length === 1) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn this._binarySearchNearestIndex(in_array.slice(0, middleIndex), in_key);\n\t\t\t}\n\n\t\t\tif (this._comparisonFunction(in_array[middleIndex], in_key) < 0) {\n\t\t\t\tif (in_array.length === 1) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tmiddleIndex +\n\t\t\t\t\t1 +\n\t\t\t\t\tthis._binarySearchNearestIndex(\n\t\t\t\t\t\tin_array.slice(middleIndex + 1, in_array.length),\n\t\t\t\t\t\tin_key,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn middleIndex;\n\t\t}\n\t}\n\n\t/**\n\t * Return the nearest next item to the given key i.e.\n\t * 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\n\t * the item mapped by '7.0.1'\n\t * @param in_key - The key to check against in order to get the nearest next item\n\t * @returns The nearest next item\n\t */\n\tgetNearestNextItem(in_key: string) {\n\t\tconst closestNextIndex = this._binarySearchNearestIndex(\n\t\t\tthis._sortedKeys,\n\t\t\tin_key.toString(),\n\t\t);\n\t\treturn closestNextIndex === this.getCount()\n\t\t\t? undefined\n\t\t\t: this.item(this._sortedKeys[closestNextIndex]);\n\t}\n\n\t/**\n\t * Return the nearest previous item to the given key i.e.\n\t * For the given list of keys ['1.0.1', '2.0.0', '2.2.0', '7.0.1'] the nearest previous item to 6.0.1 is\n\t * the item mapped by '7.0.1'\n\t * @param in_key - The key to check against in order to get the nearest previous item\n\t * @returns The nearest previous item\n\t */\n\tgetNearestPreviousItem(in_key: string | number) {\n\t\tconst closestPreviousIndex = this._binarySearchNearestIndex(\n\t\t\tthis._sortedKeys,\n\t\t\tin_key.toString(),\n\t\t);\n\t\treturn closestPreviousIndex === 0\n\t\t\t? undefined\n\t\t\t: this.item(this._sortedKeys[closestPreviousIndex - 1]);\n\t}\n}\n"]}
|
package/lib/deferredPromise.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* through the constructor's executor).
|
|
8
8
|
* For example, a deferred promise could be fulfilled after waiting for many asynchronous
|
|
9
9
|
* tasks to terminate. This class becomes useful when combining classic async calls with promises.
|
|
10
|
+
* @internal
|
|
10
11
|
*/
|
|
11
12
|
export declare class DeferredPromise<T> implements Promise<T> {
|
|
12
13
|
private _resolveSelf;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredPromise.d.ts","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"deferredPromise.d.ts","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,WAAW,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;;IAQrC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAqB;IAE7C,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxD;;;OAGG;IACH,KAAK;IAUQ,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAC/C,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EACjF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GACjF,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAIlB,KAAK,CAAC,OAAO,GAAG,KAAK,EACjC,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAC/E,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC;IAIhB,OAAO,CAAC,GAAG,EAAE,CAAC;IAGd,MAAM,CAAC,MAAM,EAAE,GAAG;CAGzB"}
|
package/lib/deferredPromise.js
CHANGED
|
@@ -8,6 +8,7 @@ var _a;
|
|
|
8
8
|
* through the constructor's executor).
|
|
9
9
|
* For example, a deferred promise could be fulfilled after waiting for many asynchronous
|
|
10
10
|
* tasks to terminate. This class becomes useful when combining classic async calls with promises.
|
|
11
|
+
* @internal
|
|
11
12
|
*/
|
|
12
13
|
export class DeferredPromise {
|
|
13
14
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredPromise.js","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH
|
|
1
|
+
{"version":3,"file":"deferredPromise.js","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,eAAe;IAK3B;QAMS,QAAoB,GAAW,iBAAiB,CAAC;QALzD,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC5B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC3B,CAAC,CAAC,CAAC;IACJ,CAAC;IAGM,KAAK,CAAC,OAAO,CAAC,SAAsB;QAC1C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,KAAK;QACJ,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,yEAAyE;YACzE,IAAI,KAAK,EAAE;gBACV,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC1B;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,WAAiF,EACjF,UAAmF;QAEnF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,KAAK,CACjB,UAAiF;QAEjF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAEM,OAAO,CAAC,GAAM;QACpB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IACM,MAAM,CAAC,MAAW;QACxB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;CACD;KAvCU,MAAM,CAAC,WAAW","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Creates a Promise that can be fulfilled or rejected later in an arbitrary manner (rather than\n * through the constructor's executor).\n * For example, a deferred promise could be fulfilled after waiting for many asynchronous\n * tasks to terminate. This class becomes useful when combining classic async calls with promises.\n * @internal\n */\nexport class DeferredPromise<T> implements Promise<T> {\n\tprivate _resolveSelf;\n\tprivate _rejectSelf;\n\tprivate readonly promise: Promise<T>;\n\n\tconstructor() {\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis._resolveSelf = resolve;\n\t\t\tthis._rejectSelf = reject;\n\t\t});\n\t}\n\treadonly [Symbol.toStringTag]: string = \"DeferredPromise\";\n\n\tpublic async finally(onfinally?: () => void): Promise<T> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\t/**\n\t * Fetches a node style callback that fulfills the promise when called.\n\t * @returns A node style callback that fulfills the promise when called.\n\t */\n\tgetCb() {\n\t\treturn (error, result) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\tif (error) {\n\t\t\t\treturn this.reject(error);\n\t\t\t}\n\t\t\treturn this.resolve(result);\n\t\t};\n\t}\n\n\tpublic async then<TResult1 = T, TResult2 = never>(\n\t\tonfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,\n\t\tonrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n\t): Promise<TResult1 | TResult2> {\n\t\treturn this.promise.then(onfulfilled, onrejected);\n\t}\n\n\tpublic async catch<TResult = never>(\n\t\tonrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null,\n\t): Promise<T | TResult> {\n\t\treturn this.promise.then(onrejected);\n\t}\n\n\tpublic resolve(val: T) {\n\t\tthis._resolveSelf(val);\n\t}\n\tpublic reject(reason: any) {\n\t\tthis._rejectSelf(reason);\n\t}\n}\n"]}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @remarks Warning: This is a very straight forward implementation based on the hashCombine4xUint32 function.
|
|
9
9
|
* It probably doesn't produce very high quality random numbers (do not use this for cryptography!) and it is not very
|
|
10
10
|
* efficient.
|
|
11
|
+
* @internal
|
|
11
12
|
*/
|
|
12
13
|
export declare class DeterministicRandomGenerator {
|
|
13
14
|
_guid1: Uint32Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deterministicRandomGenerator.d.ts","sourceRoot":"","sources":["../src/deterministicRandomGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH
|
|
1
|
+
{"version":3,"file":"deterministicRandomGenerator.d.ts","sourceRoot":"","sources":["../src/deterministicRandomGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;;;;GAOG;AACH,qBAAa,4BAA4B;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IAErB;;;OAGG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM;IAcpC;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,SAAM;IAKnB;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;CAsBhC"}
|
|
@@ -15,6 +15,7 @@ import { calculateHash } from "./hashCalculator";
|
|
|
15
15
|
* @remarks Warning: This is a very straight forward implementation based on the hashCombine4xUint32 function.
|
|
16
16
|
* It probably doesn't produce very high quality random numbers (do not use this for cryptography!) and it is not very
|
|
17
17
|
* efficient.
|
|
18
|
+
* @internal
|
|
18
19
|
*/
|
|
19
20
|
export class DeterministicRandomGenerator {
|
|
20
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deterministicRandomGenerator.js","sourceRoot":"","sources":["../src/deterministicRandomGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,+BAA+B;AAE/B,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"deterministicRandomGenerator.js","sourceRoot":"","sources":["../src/deterministicRandomGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,+BAA+B;AAE/B,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;GAOG;AACH,MAAM,OAAO,4BAA4B;IAKxC;;;OAGG;IACH,YAAY,OAAwB;QACnC,4DAA4D;QAC5D,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,QAAQ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AAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC3B,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAChC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SACjC;QAED,IAAI,MAAM,KAAK,SAAS,EAAE;YACzB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACtB;aAAM;YACN,OAAO,MAAM,GAAG,QAAQ;gBACvB,CAAC,CAAC,qDAAqD;oBACrD,+DAA+D;oBAC/D,wEAAwE;oBACxE,8CAA8C;oBAC9C,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,MAAM;gBACtC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;SAC3B;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper class to create a deterministic sequence of random numbers.\n */\n\n/* eslint-disable no-bitwise */\n\nimport _ from \"lodash\";\nimport { GuidUtils } from \"./guidUtils\";\nimport { calculateHash } from \"./hashCalculator\";\n\n/**\n * Random number generator that creates a deterministic sequence of random numbers based on an initial seed GUID.\n *\n * @remarks Warning: This is a very straight forward implementation based on the hashCombine4xUint32 function.\n * It probably doesn't produce very high quality random numbers (do not use this for cryptography!) and it is not very\n * efficient.\n * @internal\n */\nexport class DeterministicRandomGenerator {\n\t_guid1: Uint32Array;\n\t_guid2: Uint32Array;\n\t_result: Uint32Array;\n\n\t/**\n\t * @param in_seed - The initial seed (it can be either a GUID or a number)\n\t * which is used to initialize the random number generator.\n\t */\n\tconstructor(in_seed: string | number) {\n\t\t// Initialize the internal state from the given initial guid\n\t\tthis._guid1 = _.isString(in_seed)\n\t\t\t? GuidUtils.guidToUint32x4(in_seed)\n\t\t\t: GuidUtils.guidToUint32x4(calculateHash(String(in_seed)));\n\t\tthis._guid2 = new Uint32Array(4);\n\t\tthis._guid2[0] = (this._guid1[0] + 1) >>> 0;\n\t\tthis._guid2[1] = (this._guid1[1] + 1) >>> 0;\n\t\tthis._guid2[2] = (this._guid1[2] + 1) >>> 0;\n\t\tthis._guid2[3] = (this._guid1[3] + 1) >>> 0;\n\n\t\tthis._result = new Uint32Array(4);\n\t}\n\n\t/**\n\t * Creates a floating point random number.\n\t *\n\t * @param in_max - If supplied the returned number will be 0 \\<= number \\< `in_max`.\n\t * If none is given, `in_max` = 1 is assumed.\n\t *\n\t * @returns The random number.\n\t */\n\trandom(in_max = 1.0) {\n\t\tconst randomInteger = this.irandom();\n\t\treturn (randomInteger / 4294967296) * in_max;\n\t}\n\n\t/**\n\t * Creates an integer point random number.\n\t *\n\t * @param in_max - If supplied the returned number will be 0 \\<= number \\< `in_max`.\n\t * If none is given, `in_max` = 14294967296 (2^32) is assumed.\n\t *\n\t * @returns The random number.\n\t */\n\tirandom(in_max?: number): number {\n\t\t// Create a new hash\n\t\tGuidUtils.hashCombine4xUint32(this._guid1, this._guid2, this._result);\n\n\t\t// Permute the hashes\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tthis._guid1[i] = this._guid2[i];\n\t\t\tthis._guid2[i] = this._result[i];\n\t\t}\n\n\t\tif (in_max === undefined) {\n\t\t\treturn this._guid1[0];\n\t\t} else {\n\t\t\treturn in_max < 16777619\n\t\t\t\t? // The random generator doesn't seem to be very good.\n\t\t\t\t // It is quite biased (e.g. it generates too many even numbers)\n\t\t\t\t // this is a hack to solve at least this problem, but we probably should\n\t\t\t\t // instead use a different approach altogether\n\t\t\t\t (this._guid1[0] % 16777619) % in_max\n\t\t\t\t: this._guid1[0] % in_max;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flaggedError.d.ts","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,qBAAa,YAAY;IACxB;;OAEG;IACH,MAAM,CAAC,KAAK;QACX;;WAEG;;QAEH;;WAEG;;MAEF;IAEF,SAAS,CAAC,KAAK,EAAE,MAAM,CAAK;IAE5B;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,WAAW,IAAI,OAAO;CAGtB"}
|
|
1
|
+
{"version":3,"file":"flaggedError.d.ts","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,qBAAa,YAAY;IACxB;;OAEG;IACH,MAAM,CAAC,KAAK;QACX;;WAEG;;QAEH;;WAEG;;MAEF;IAEF,SAAS,CAAC,KAAK,EAAE,MAAM,CAAK;IAE5B;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,WAAW,IAAI,OAAO;CAGtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,OAAO,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IAbA;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA5BD;;GAEG;AACI,kBAAK,GAAG;IACd;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACR,AATW,CASV","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Checks if a flag is set\n * @param flags - Flags set within an error object\n * @param flag - A flag to be checked\n * @returns True if the flag is set in passed flags, false otherwise.\n */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IAbA;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA5BD;;GAEG;AACI,kBAAK,GAAG;IACd;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACR,AATW,CASV","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Checks if a flag is set\n * @param flags - Flags set within an error object\n * @param flag - A flag to be checked\n * @returns True if the flag is set in passed flags, false otherwise.\n */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\n/**\n * @internal\n */\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @param method - The HTTP method used in the request
|
|
7
7
|
* @param url - The URL that the request was sent to
|
|
8
8
|
* @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
|
|
9
|
+
* @internal
|
|
9
10
|
*/
|
|
10
11
|
export declare class HTTPError extends Error {
|
|
11
12
|
title?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;IACN,UAAU,CAAC;IACX,aAAa,CAAC;IACd,MAAM,CAAC;IACP,GAAG,CAAC;IACJ,KAAK;gBALL,KAAK,CAAC,oBAAQ,EACd,UAAU,CAAC,oBAAQ,EACnB,aAAa,CAAC,oBAAQ,EACtB,MAAM,CAAC,oBAAQ,EACf,GAAG,CAAC,oBAAQ,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAYlB"}
|
|
@@ -11,6 +11,7 @@ import { FlaggedError } from "./flaggedError";
|
|
|
11
11
|
* @param method - The HTTP method used in the request
|
|
12
12
|
* @param url - The URL that the request was sent to
|
|
13
13
|
* @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
|
|
14
|
+
* @internal
|
|
14
15
|
*/
|
|
15
16
|
export class HTTPError extends Error {
|
|
16
17
|
constructor(title, statusCode, statusMessage, method, url, flags = 0) {
|