@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.
Files changed (69) hide show
  1. package/dist/consoleUtils.d.ts +2 -2
  2. package/dist/consoleUtils.js +2 -2
  3. package/dist/consoleUtils.js.map +1 -1
  4. package/dist/constants.d.ts +1 -1
  5. package/dist/constants.js +1 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/datastructures/collection.d.ts +5 -5
  8. package/dist/datastructures/collection.js +5 -5
  9. package/dist/datastructures/collection.js.map +1 -1
  10. package/dist/datastructures/dataArray.d.ts +7 -7
  11. package/dist/datastructures/dataArray.d.ts.map +1 -1
  12. package/dist/datastructures/dataArray.js +7 -7
  13. package/dist/datastructures/dataArray.js.map +1 -1
  14. package/dist/datastructures/integer64.d.ts +4 -4
  15. package/dist/datastructures/integer64.d.ts.map +1 -1
  16. package/dist/datastructures/integer64.js +9 -9
  17. package/dist/datastructures/integer64.js.map +1 -1
  18. package/dist/datastructures/sortedCollection.d.ts +1 -1
  19. package/dist/datastructures/sortedCollection.js +1 -1
  20. package/dist/datastructures/sortedCollection.js.map +1 -1
  21. package/dist/error_objects/flaggedError.js +3 -3
  22. package/dist/error_objects/flaggedError.js.map +1 -1
  23. package/dist/guidUtils.d.ts.map +1 -1
  24. package/dist/guidUtils.js +2 -3
  25. package/dist/guidUtils.js.map +1 -1
  26. package/dist/packageVersion.d.ts +1 -1
  27. package/dist/packageVersion.d.ts.map +1 -1
  28. package/dist/packageVersion.js +1 -1
  29. package/dist/packageVersion.js.map +1 -1
  30. package/lib/consoleUtils.d.ts +2 -2
  31. package/lib/consoleUtils.js +2 -2
  32. package/lib/consoleUtils.js.map +1 -1
  33. package/lib/constants.d.ts +1 -1
  34. package/lib/constants.js +1 -1
  35. package/lib/constants.js.map +1 -1
  36. package/lib/datastructures/collection.d.ts +5 -5
  37. package/lib/datastructures/collection.js +5 -5
  38. package/lib/datastructures/collection.js.map +1 -1
  39. package/lib/datastructures/dataArray.d.ts +7 -7
  40. package/lib/datastructures/dataArray.d.ts.map +1 -1
  41. package/lib/datastructures/dataArray.js +7 -7
  42. package/lib/datastructures/dataArray.js.map +1 -1
  43. package/lib/datastructures/integer64.d.ts +4 -4
  44. package/lib/datastructures/integer64.d.ts.map +1 -1
  45. package/lib/datastructures/integer64.js +9 -9
  46. package/lib/datastructures/integer64.js.map +1 -1
  47. package/lib/datastructures/sortedCollection.d.ts +1 -1
  48. package/lib/datastructures/sortedCollection.js +1 -1
  49. package/lib/datastructures/sortedCollection.js.map +1 -1
  50. package/lib/error_objects/flaggedError.js +3 -3
  51. package/lib/error_objects/flaggedError.js.map +1 -1
  52. package/lib/guidUtils.d.ts.map +1 -1
  53. package/lib/guidUtils.js +2 -3
  54. package/lib/guidUtils.js.map +1 -1
  55. package/lib/packageVersion.d.ts +1 -1
  56. package/lib/packageVersion.d.ts.map +1 -1
  57. package/lib/packageVersion.js +1 -1
  58. package/lib/packageVersion.js.map +1 -1
  59. package/package.json +2 -2
  60. package/platform-dependent/package.json +1 -1
  61. package/src/consoleUtils.ts +2 -2
  62. package/src/constants.ts +1 -1
  63. package/src/datastructures/collection.ts +5 -5
  64. package/src/datastructures/dataArray.ts +8 -7
  65. package/src/datastructures/integer64.ts +10 -9
  66. package/src/datastructures/sortedCollection.ts +1 -1
  67. package/src/error_objects/flaggedError.ts +3 -3
  68. package/src/guidUtils.ts +2 -3
  69. package/src/packageVersion.ts +1 -1
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- @fileoverview The data arrays definition file.
6
+ * The data arrays definition file.
7
7
  */
8
8
  /**
9
9
  * A typed data container that is persistable, high-performance, and can be used
@@ -121,9 +121,9 @@ declare class BaseDataArray {
121
121
  */
122
122
  protected _alloc(size: number): any;
123
123
  /**
124
- * change the size of the array
125
- * @param size - the target size
126
- * @returns the DataArray itself
124
+ * Change the size of the array
125
+ * @param size - The target size
126
+ * @returns The DataArray itself
127
127
  */
128
128
  resize(size: number): this;
129
129
  copy(): any;
@@ -169,9 +169,9 @@ declare class UniversalDataArray extends BaseDataArray {
169
169
  */
170
170
  private arraySet;
171
171
  /**
172
- * insert the content of an array into the DataArray
173
- * @param in_offset - the target index
174
- * @param in_array - the array to be inserted
172
+ * Insert the content of an array into the DataArray
173
+ * @param in_offset - The target index
174
+ * @param in_array - The array to be inserted
175
175
  */
176
176
  insertRange(in_offset: number, in_array: any[]): void;
177
177
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"dataArray.d.ts","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AAEH;;;GAGG;AACH,cAAM,aAAa;IACf,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;;;;OAIG;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,EAAE,SAAS,EAAE,MAAM;IAQpD;;;OAGG;IACH,SAAS,IAAI,MAAM,EAAE;IAIrB;;;OAGG;IACH,WAAW,CAAC,aAAa,KAAA;IAazB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAA;IAQjC;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAShC;;;;OAIG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IASrD;;;;;;OAMG;IACH,OAAO,CAAC,OAAO;IAUf;;;;OAIG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,KAAA;IAK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IAKhD;;;;OAIG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IASrD;;;;;OAKG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAKxC;;;;;OAKG;IACH,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAO7D,IAAI,MAAM,QAAkC;CAC/C;AAED;;GAEG;AACH,cAAM,aAAc,SAAQ,kBAAkB;IAC1C;;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;;;;;OAKG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,KAAA;CASlC;AAED,OAAO,EACH,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,GAChB,CAAC"}
@@ -8,7 +8,7 @@ exports.BoolDataArray = exports.StringDataArray = exports.UniversalDataArray = e
8
8
  /* eslint-disable @typescript-eslint/no-unsafe-return */
9
9
  /* eslint accessor-pairs: [2, { "getWithoutSet": false }] */
10
10
  /**
11
- @fileoverview The data arrays definition file.
11
+ * The data arrays definition file.
12
12
  */
13
13
  /**
14
14
  * A typed data container that is persistable, high-performance, and can be used
@@ -226,9 +226,9 @@ class BaseDataArray {
226
226
  return this;
227
227
  }
228
228
  /**
229
- * change the size of the array
230
- * @param size - the target size
231
- * @returns the DataArray itself
229
+ * Change the size of the array
230
+ * @param size - The target size
231
+ * @returns The DataArray itself
232
232
  */
233
233
  resize(size) {
234
234
  this._alloc(size);
@@ -321,9 +321,9 @@ class UniversalDataArray extends BaseDataArray {
321
321
  });
322
322
  }
323
323
  /**
324
- * insert the content of an array into the DataArray
325
- * @param in_offset - the target index
326
- * @param in_array - the array to be inserted
324
+ * Insert the content of an array into the DataArray
325
+ * @param in_offset - The target index
326
+ * @param in_array - The array to be inserted
327
327
  */
328
328
  insertRange(in_offset, in_array) {
329
329
  this._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));
@@ -1 +1 @@
1
- {"version":3,"file":"dataArray.js","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,wDAAwD;AACxD,4DAA4D;AAC5D;;GAEG;AAEH;;;GAGG;AACH,MAAM,aAAa;IAaf,YAAY,CAAC,EAAE,CAAE;QACb,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YACvB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;YACd,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;SACjD;aAAM;YACH,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;SACjB;QACD,6DAA6D;QAC7D,mDAAmD;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,8BAA8B;IACxF,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAM,GAAG,CAAC;QACf,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,GAAG,CAAC,EAAE;YACnC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACtD;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,WAAmB,EAAE,SAAiB;QAChD,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS,GAAG,IAAI,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC,IAAI,SAAS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AAO,EAAE,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,SAAiB,EAAE,QAAQ;QAC3B,IAAI,QAAQ,YAAY,WAAW,IAAI,QAAQ,YAAY,KAAK,IAAI,QAAQ,YAAY,IAAI,CAAC,aAAa,EAAE,EAAE;YAC1G,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;SACxD;aAAM,IAAI,QAAQ,YAAY,aAAa,EAAE;YAC1C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;SACpE;aAAM;YACH,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACvF;IACL,CAAC;CACJ;AAcG,sCAAa","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 @fileoverview 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 protected _buffer: any;\n private readonly bufferConstructor;\n protected size: number;\n\n constructor(size: number);\n\n /**\n * @param bufferConstructor - This is the constructor to be used to\n * setup the internal buffer of the DataArray.\n * @param size - The initial size with which to allocate the array.\n */\n constructor(bufferConstructor: any, size: number);\n constructor(a, b?) {\n if (typeof a === \"number\") {\n this.size = a;\n this.bufferConstructor = this.getBufferCtor();\n } else {\n this.bufferConstructor = a;\n this.size = b;\n }\n // The 'eslint-...' is used to disable the rule that requires\n // constructors to start with a capitalized letter.\n this._buffer = new this.bufferConstructor(this.size); // eslint-disable-line new-cap\n }\n\n /**\n * Get the value at an index. If no index is passed, return zeroth item.\n * @param in_idx - the specific item in the data array.\n * @returns the value at that index\n */\n getValue(in_idx = 0): any {\n if (in_idx >= this.size || in_idx < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n\n return this._buffer[in_idx];\n }\n\n /**\n * Return a range of values in the array.\n * @param in_idxStart - the starting index\n * @param in_idxEnd - the end index\n * @returns the array of values in the range\n */\n getValueRange(in_idxStart: number, in_idxEnd: number) {\n if (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n\n return this._buffer.subarray(in_idxStart, in_idxEnd);\n }\n\n /**\n * Return the serialized form of Data Arrays.\n * @returns An object containing an array of the values.\n */\n serialize(): number[] {\n return Array.from(this._buffer.subarray(0, this.size));\n }\n\n /**\n * Deserialize data from a serialized representation\n * @param in_serialized - the serialized representation\n */\n deserialize(in_serialized) {\n const values = in_serialized;\n const length = in_serialized.length;\n if (length !== this.size) {\n this.resize(length);\n this.size = length;\n }\n let i;\n for (i = 0; i < length; i++) {\n this._buffer[i] = values[i];\n }\n }\n\n /**\n * Set value at an index.\n * @param in_idx - the index\n * @param in_value - the value we want to set at index\n */\n setValue(in_idx: number, in_value) {\n if (in_idx < this._buffer.length) {\n this._buffer[in_idx] = in_value;\n } else {\n console.error(\"DataArray setValue in_idx is out of bounds.\");\n }\n }\n\n /**\n * creates a copy of a typed array with removed elements\n * @param in_arr - the input array (won't be modified)\n * @param in_offset - starting index of range that will be removed\n * @param in_deleteCount - number of removed elements\n * @returns a copy of the input array without the selected range\n */\n private _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n // TODO: this function can be optimized\n const newSize = this.size - in_deleteCount;\n const splicedArray = new in_arr.constructor(newSize);\n splicedArray.set(in_arr.subarray(0, in_offset));\n splicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n return splicedArray;\n }\n\n /**\n * remove a range of elements from the array\n * @param in_offset - start of the range\n * @param in_deleteCount - number of elements to be removed\n */\n removeRange(in_offset: number, in_deleteCount: number) {\n if (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n this._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n this.size = this.size - in_deleteCount;\n } else {\n console.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n }\n }\n\n /**\n * copy an array with elements inserted into the copy\n * @param in_arr - the input array (won't be modified)\n * @param in_offset - the index where the new elements will be inserted\n * @param in_addedArray - the array with the elements that will be added\n * @returns the combined array\n */\n private _insert(in_arr, in_offset: number, in_addedArray) {\n // TODO: this function can be optimized\n const newSize = this.size + (in_addedArray.length as number);\n const insertedArray = new in_arr.constructor(newSize);\n insertedArray.set(in_arr.subarray(0, in_offset));\n insertedArray.set(in_addedArray, in_offset);\n insertedArray.set(in_arr.subarray(in_offset, this.size), in_offset + (in_addedArray.length as number));\n return insertedArray;\n }\n\n /**\n * insert the content of an array into the DataArray\n * @param in_offset - the target index\n * @param in_array - the array to be inserted\n */\n insertRange(in_offset: number, in_array) {\n this._buffer = this._insert(this._buffer, in_offset, in_array);\n this.size = this.size + (in_array.length as number);\n }\n\n /**\n * Set this array values to be equal to in_array values\n * @param in_offset - An optional offset in this array to begin start\n * setting this arrays values to in_array values.\n * @param in_array - the input array\n */\n set(in_offset: number, in_array) {\n if (in_array instanceof ArrayBuffer || in_array instanceof Array || in_array instanceof this.getBufferCtor()) {\n this._buffer.set(in_array, in_offset);\n } else if (in_array instanceof BaseDataArray) {\n this._buffer.set(in_array.getBuffer(), in_offset);\n } else {\n console.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n }\n }\n\n /**\n * insert a value at the end of the array, creates a new element at the end and sets the value\n * @param in_value - the new value\n */\n push(in_value) {\n // Adjust the buffer if necessary\n const bufferLength = this._buffer.length;\n if (this.size > bufferLength - 1) {\n this._alloc(this.size * 2 || 1); // grow by a factor of 2x\n }\n // set the value and update size\n this.setValue(this.size, in_value);\n this.size++;\n }\n\n /**\n * get direct access to the data (for performance reasons)\n * this should be uses read only\n * @returns the (read only) raw data\n */\n getBuffer() {\n return this._buffer;\n }\n\n /**\n * get the constructor of the underlying TypedArray\n * @returns the constructor for the data buffer\n */\n getBufferCtor() {\n return this.bufferConstructor;\n }\n\n /**\n * apply a given function to all elements of the array\n * @param in_fn - the function that will be applied to every element\n */\n iterate(in_fn) {\n const l = this.size;\n for (let i = 0; i < l; i++) {\n in_fn(this._buffer[i]);\n }\n }\n\n /**\n * get a resized buffer copy\n * @param in_bufferCtor - the constructor for the returned buffer\n * @param in_buffer - the input buffer (won't be modified)\n * @param in_newSize - the target size\n * @returns the buffer with the new size\n */\n private resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n // target buffer with the desired new size\n // The 'eslint-...' is used to disable the rule that requires\n // constructors to start with a capitalized letter.\n const newBuffer = new in_bufferCtor(in_newSize); // eslint-disable-line new-cap\n const oldSize = in_buffer.length;\n const oldBuffer = in_buffer;\n const isShrinking = oldSize > in_newSize;\n newBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n return newBuffer;\n }\n\n /**\n * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n * which makes pushes to the array less expensive later)\n * @param size - the target allocated space\n * @returns the DataArray itself\n */\n protected _alloc(size: number): any {\n this._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n return this;\n }\n\n /**\n * change the size of the array\n * @param size - the target size\n * @returns the DataArray itself\n */\n resize(size: number) { // this can be costly!!!\n this._alloc(size);\n this.size = size;\n return this;\n }\n\n copy() { // and this!\n const newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n newBuffer.set(this._buffer);\n return newBuffer;\n }\n\n get length() {\n return this.size;\n }\n}\n\nclass Int8DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Int8Array, size);\n }\n}\n\nclass Int16DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Int16Array, size);\n }\n}\n\nclass Int32DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Int32Array, size);\n }\n}\n\nclass Uint8DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Uint8Array, size);\n }\n}\n\nclass Uint16DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Uint16Array, size);\n }\n}\n\nclass Uint32DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Uint32Array, size);\n }\n}\n\nclass Float32DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Float32Array, size);\n }\n}\n\nclass Float64DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Float64Array, size);\n }\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 constructor(bufferConstructor: any, size: number);\n constructor(size: number);\n constructor(a?, b?) {\n if (b === undefined) {\n super(Array, a);\n } else {\n super(a, b);\n }\n }\n\n /**\n * helper function to write array values into another array at a given offset\n * @param array - target array\n * @param values - the values we need to write\n * @param offset - starting index in target array\n */\n private arraySet(array, values, offset = 0) {\n let index = 0;\n values.forEach(function(value) {\n array[index + offset] = value;\n index++;\n });\n }\n\n /**\n * insert the content of an array into the DataArray\n * @param in_offset - the target index\n * @param in_array - the array to be inserted\n */\n insertRange(in_offset: number, in_array: any[]) {\n this._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n this.size = this.size + in_array.length;\n }\n\n /**\n * remove a range of elements from the array\n * @param in_offset - start of the range\n * @param in_deleteCount - number of elements to be removed\n */\n removeRange(in_offset: number, in_deleteCount: number) {\n if (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n this._buffer.splice(in_offset, in_deleteCount);\n this.size -= in_deleteCount;\n } else {\n throw Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n }\n }\n\n /**\n * Set this array values to be equal to in_array values\n * @param in_offset - An optional offset in this array to begin start\n * setting this arrays values to in_array values.\n * @param in_array - the input array\n */\n set(in_offset: number, in_array) {\n if (in_array instanceof ArrayBuffer || in_array instanceof Array || in_array instanceof this.getBufferCtor()) {\n this.arraySet(this._buffer, in_array, in_offset);\n } else if (in_array instanceof BaseDataArray) {\n this.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n } else {\n console.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n }\n }\n\n /**\n * Return a range of values in the array.\n * @param in_idxStart - the starting index\n * @param in_idxEnd - the end index - this offset is exclusive\n * @returns the array of values in the range\n */\n getValueRange(in_idxStart: number, in_idxEnd: number) {\n if (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n return this._buffer.slice(in_idxStart, in_idxEnd);\n }\n\n /**\n * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n * @param in_buffer - input buffer - not changed\n * @param in_newSize - target size\n * @returns an Array of the new size\n */\n private resizeBufferArray(in_buffer, in_newSize) {\n // target buffer with the desired new size\n const newBuffer = new Array(in_newSize);\n const oldSize = in_buffer.length;\n const oldBuffer = in_buffer;\n const isShrinking = oldSize > in_newSize;\n this.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n return newBuffer;\n }\n\n /**\n * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n * which makes pushes to the array less expensive later)\n * @param size - the target allocated space\n * @returns the DataArray itself\n */\n protected _alloc(size: number): any {\n this._buffer = this.resizeBufferArray(this._buffer, size);\n return this;\n }\n}\n\n/**\n * A data container that contains a string\n */\nclass StringDataArray extends BaseDataArray {\n constructor() {\n super(String, 0);\n this.size = 0;\n this._buffer = \"\";\n }\n /**\n * insert the content of a string into the StringDataArray\n * @param in_offset - the target index\n * @param in_string - the string to be inserted\n */\n insertRange(in_offset: number, in_string: string) {\n this._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(in_offset)}`;\n this.size = this.size + in_string.length;\n }\n\n /**\n * remove a range of elements from the string\n * @param in_offset - start of the range\n * @param in_deleteCount - number of elements to be removed\n */\n removeRange(in_offset: number, in_deleteCount: number) {\n if (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n this._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(in_offset + in_deleteCount)}`;\n this.size -= in_deleteCount;\n } else {\n throw Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n }\n }\n\n /**\n * Set this array values to be equal to in_string values\n * @param in_offset - The offset in this array to begin start\n * setting this arrays values to in_string values.\n * @param in_string - the input string\n */\n set(in_offset: number, in_string: string) {\n this._buffer =\n `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(in_offset + in_string.length)}`;\n }\n\n /**\n * Return a range of characters in the string.\n * @param in_idxStart - the starting index\n * @param in_idxEnd - the end index - this offset is exclusive\n * @returns the characters in the range\n */\n getValueRange(in_idxStart: number, in_idxEnd: number): string {\n if (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n return this._buffer.slice(in_idxStart, in_idxEnd);\n }\n\n get length() { return this._buffer.length; }\n}\n\n/**\n * A data container that can contain boolean type\n */\nclass BoolDataArray extends UniversalDataArray {\n /**\n * @param size - The initial size with which to allocate the array.\n */\n constructor(size: number) {\n super(Array, size);\n }\n\n /**\n * helper function to write and cast to boolean array values into another array at a given offset\n * @param array - target array\n * @param values - the values we need to write\n * @param offset - starting index in target array\n */\n private arraySetBool(array, values, offset = 0) {\n let index = 0;\n values.forEach(function(value) {\n array[index + offset] = !!(value as boolean);\n index++;\n });\n }\n\n /**\n * insert the content of an array into the DataArray\n * @param in_offset - the target index\n * @param in_array - the array to be inserted\n */\n insertRange(in_offset: number, in_array: any[]) {\n const toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n this._buffer.splice.call(this._buffer, ...([in_offset, 0].concat(toBeAdded)));\n this.size = this.size + in_array.length;\n }\n\n /**\n * Set this array values to be equal to in_array values\n * @param in_offset - An optional offset in this array to begin start\n * setting this arrays values to in_array values.\n * @param in_array - the input array\n */\n set(in_offset: number, in_array) {\n if (in_array instanceof ArrayBuffer || in_array instanceof Array || in_array instanceof this.getBufferCtor()) {\n this.arraySetBool(this._buffer, in_array, in_offset);\n } else if (in_array instanceof BaseDataArray) {\n this.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n } else {\n console.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n }\n }\n}\n\nexport {\n BaseDataArray,\n Float32DataArray,\n Float64DataArray,\n Int8DataArray,\n Int16DataArray,\n Int32DataArray,\n Uint8DataArray,\n Uint16DataArray,\n Uint32DataArray,\n UniversalDataArray,\n StringDataArray,\n BoolDataArray,\n};\n"]}
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;IAaf,YAAY,CAAC,EAAE,CAAE;QACb,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YACvB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;YACd,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;SACjD;aAAM;YACH,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;SACjB;QACD,6DAA6D;QAC7D,mDAAmD;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,8BAA8B;IACxF,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAM,GAAG,CAAC;QACf,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,GAAG,CA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B,CAAC;YAC7C,KAAK,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,SAAiB,EAAE,QAAe;QAC1C,MAAM,SAAS,GAAU,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAE,GAAe,CAAC,CAAC;QACnE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,SAAiB,EAAE,QAAQ;QAC3B,IAAI,QAAQ,YAAY,WAAW,IAAI,QAAQ,YAAY,KAAK,IAAI,QAAQ,YAAY,IAAI,CAAC,aAAa,EAAE,EAAE;YAC1G,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;SACxD;aAAM,IAAI,QAAQ,YAAY,aAAa,EAAE;YAC1C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;SACpE;aAAM;YACH,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACvF;IACL,CAAC;CACJ;AAcG,sCAAa","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 protected _buffer: any;\n private readonly bufferConstructor;\n protected size: number;\n\n constructor(size: number);\n\n /**\n * @param bufferConstructor - This is the constructor to be used to\n * setup the internal buffer of the DataArray.\n * @param size - The initial size with which to allocate the array.\n */\n constructor(bufferConstructor: any, size: number);\n constructor(a, b?) {\n if (typeof a === \"number\") {\n this.size = a;\n this.bufferConstructor = this.getBufferCtor();\n } else {\n this.bufferConstructor = a;\n this.size = b;\n }\n // The 'eslint-...' is used to disable the rule that requires\n // constructors to start with a capitalized letter.\n this._buffer = new this.bufferConstructor(this.size); // eslint-disable-line new-cap\n }\n\n /**\n * Get the value at an index. If no index is passed, return zeroth item.\n * @param in_idx - the specific item in the data array.\n * @returns the value at that index\n */\n getValue(in_idx = 0): any {\n if (in_idx >= this.size || in_idx < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n\n return this._buffer[in_idx];\n }\n\n /**\n * Return a range of values in the array.\n * @param in_idxStart - the starting index\n * @param in_idxEnd - the end index\n * @returns the array of values in the range\n */\n getValueRange(in_idxStart: number, in_idxEnd: number) {\n if (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n\n return this._buffer.subarray(in_idxStart, in_idxEnd);\n }\n\n /**\n * Return the serialized form of Data Arrays.\n * @returns An object containing an array of the values.\n */\n serialize(): number[] {\n return Array.from(this._buffer.subarray(0, this.size));\n }\n\n /**\n * Deserialize data from a serialized representation\n * @param in_serialized - the serialized representation\n */\n deserialize(in_serialized) {\n const values = in_serialized;\n const length = in_serialized.length;\n if (length !== this.size) {\n this.resize(length);\n this.size = length;\n }\n let i;\n for (i = 0; i < length; i++) {\n this._buffer[i] = values[i];\n }\n }\n\n /**\n * Set value at an index.\n * @param in_idx - the index\n * @param in_value - the value we want to set at index\n */\n setValue(in_idx: number, in_value) {\n if (in_idx < this._buffer.length) {\n this._buffer[in_idx] = in_value;\n } else {\n console.error(\"DataArray setValue in_idx is out of bounds.\");\n }\n }\n\n /**\n * creates a copy of a typed array with removed elements\n * @param in_arr - the input array (won't be modified)\n * @param in_offset - starting index of range that will be removed\n * @param in_deleteCount - number of removed elements\n * @returns a copy of the input array without the selected range\n */\n private _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n // TODO: this function can be optimized\n const newSize = this.size - in_deleteCount;\n const splicedArray = new in_arr.constructor(newSize);\n splicedArray.set(in_arr.subarray(0, in_offset));\n splicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n return splicedArray;\n }\n\n /**\n * remove a range of elements from the array\n * @param in_offset - start of the range\n * @param in_deleteCount - number of elements to be removed\n */\n removeRange(in_offset: number, in_deleteCount: number) {\n if (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n this._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n this.size = this.size - in_deleteCount;\n } else {\n console.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n }\n }\n\n /**\n * copy an array with elements inserted into the copy\n * @param in_arr - the input array (won't be modified)\n * @param in_offset - the index where the new elements will be inserted\n * @param in_addedArray - the array with the elements that will be added\n * @returns the combined array\n */\n private _insert(in_arr, in_offset: number, in_addedArray) {\n // TODO: this function can be optimized\n const newSize = this.size + (in_addedArray.length as number);\n const insertedArray = new in_arr.constructor(newSize);\n insertedArray.set(in_arr.subarray(0, in_offset));\n insertedArray.set(in_addedArray, in_offset);\n insertedArray.set(in_arr.subarray(in_offset, this.size), in_offset + (in_addedArray.length as number));\n return insertedArray;\n }\n\n /**\n * insert the content of an array into the DataArray\n * @param in_offset - the target index\n * @param in_array - the array to be inserted\n */\n insertRange(in_offset: number, in_array) {\n this._buffer = this._insert(this._buffer, in_offset, in_array);\n this.size = this.size + (in_array.length as number);\n }\n\n /**\n * Set this array values to be equal to in_array values\n * @param in_offset - An optional offset in this array to begin start\n * setting this arrays values to in_array values.\n * @param in_array - the input array\n */\n set(in_offset: number, in_array) {\n if (in_array instanceof ArrayBuffer || in_array instanceof Array || in_array instanceof this.getBufferCtor()) {\n this._buffer.set(in_array, in_offset);\n } else if (in_array instanceof BaseDataArray) {\n this._buffer.set(in_array.getBuffer(), in_offset);\n } else {\n console.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n }\n }\n\n /**\n * insert a value at the end of the array, creates a new element at the end and sets the value\n * @param in_value - the new value\n */\n push(in_value) {\n // Adjust the buffer if necessary\n const bufferLength = this._buffer.length;\n if (this.size > bufferLength - 1) {\n this._alloc(this.size * 2 || 1); // grow by a factor of 2x\n }\n // set the value and update size\n this.setValue(this.size, in_value);\n this.size++;\n }\n\n /**\n * get direct access to the data (for performance reasons)\n * this should be uses read only\n * @returns the (read only) raw data\n */\n getBuffer() {\n return this._buffer;\n }\n\n /**\n * get the constructor of the underlying TypedArray\n * @returns the constructor for the data buffer\n */\n getBufferCtor() {\n return this.bufferConstructor;\n }\n\n /**\n * apply a given function to all elements of the array\n * @param in_fn - the function that will be applied to every element\n */\n iterate(in_fn) {\n const l = this.size;\n for (let i = 0; i < l; i++) {\n in_fn(this._buffer[i]);\n }\n }\n\n /**\n * get a resized buffer copy\n * @param in_bufferCtor - the constructor for the returned buffer\n * @param in_buffer - the input buffer (won't be modified)\n * @param in_newSize - the target size\n * @returns the buffer with the new size\n */\n private resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n // target buffer with the desired new size\n // The 'eslint-...' is used to disable the rule that requires\n // constructors to start with a capitalized letter.\n const newBuffer = new in_bufferCtor(in_newSize); // eslint-disable-line new-cap\n const oldSize = in_buffer.length;\n const oldBuffer = in_buffer;\n const isShrinking = oldSize > in_newSize;\n newBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n return newBuffer;\n }\n\n /**\n * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n * which makes pushes to the array less expensive later)\n * @param size - the target allocated space\n * @returns the DataArray itself\n */\n protected _alloc(size: number): any {\n this._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n return this;\n }\n\n /**\n * Change the size of the array\n * @param size - The target size\n * @returns The DataArray itself\n */\n resize(size: number) { // this can be costly!!!\n this._alloc(size);\n this.size = size;\n return this;\n }\n\n copy() { // and this!\n const newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n newBuffer.set(this._buffer);\n return newBuffer;\n }\n\n get length() {\n return this.size;\n }\n}\n\nclass Int8DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Int8Array, size);\n }\n}\n\nclass Int16DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Int16Array, size);\n }\n}\n\nclass Int32DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Int32Array, size);\n }\n}\n\nclass Uint8DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Uint8Array, size);\n }\n}\n\nclass Uint16DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Uint16Array, size);\n }\n}\n\nclass Uint32DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Uint32Array, size);\n }\n}\n\nclass Float32DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Float32Array, size);\n }\n}\n\nclass Float64DataArray extends BaseDataArray {\n constructor(size: number) {\n super(Float64Array, size);\n }\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 constructor(bufferConstructor: any, size: number);\n constructor(size: number);\n constructor(a?, b?) {\n if (b === undefined) {\n super(Array, a);\n } else {\n super(a, b);\n }\n }\n\n /**\n * helper function to write array values into another array at a given offset\n * @param array - target array\n * @param values - the values we need to write\n * @param offset - starting index in target array\n */\n private arraySet(array, values, offset = 0) {\n let index = 0;\n values.forEach(function(value) {\n array[index + offset] = value;\n index++;\n });\n }\n\n /**\n * Insert the content of an array into the DataArray\n * @param in_offset - The target index\n * @param in_array - The array to be inserted\n */\n insertRange(in_offset: number, in_array: any[]) {\n this._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n this.size = this.size + in_array.length;\n }\n\n /**\n * remove a range of elements from the array\n * @param in_offset - start of the range\n * @param in_deleteCount - number of elements to be removed\n */\n removeRange(in_offset: number, in_deleteCount: number) {\n if (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n this._buffer.splice(in_offset, in_deleteCount);\n this.size -= in_deleteCount;\n } else {\n throw Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n }\n }\n\n /**\n * Set this array values to be equal to in_array values\n * @param in_offset - An optional offset in this array to begin start\n * setting this arrays values to in_array values.\n * @param in_array - the input array\n */\n set(in_offset: number, in_array) {\n if (in_array instanceof ArrayBuffer || in_array instanceof Array || in_array instanceof this.getBufferCtor()) {\n this.arraySet(this._buffer, in_array, in_offset);\n } else if (in_array instanceof BaseDataArray) {\n this.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n } else {\n console.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n }\n }\n\n /**\n * Return a range of values in the array.\n * @param in_idxStart - the starting index\n * @param in_idxEnd - the end index - this offset is exclusive\n * @returns the array of values in the range\n */\n getValueRange(in_idxStart: number, in_idxEnd: number) {\n if (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n return this._buffer.slice(in_idxStart, in_idxEnd);\n }\n\n /**\n * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n * @param in_buffer - input buffer - not changed\n * @param in_newSize - target size\n * @returns an Array of the new size\n */\n private resizeBufferArray(in_buffer, in_newSize) {\n // target buffer with the desired new size\n const newBuffer = new Array(in_newSize);\n const oldSize = in_buffer.length;\n const oldBuffer = in_buffer;\n const isShrinking = oldSize > in_newSize;\n this.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n return newBuffer;\n }\n\n /**\n * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n * which makes pushes to the array less expensive later)\n * @param size - the target allocated space\n * @returns the DataArray itself\n */\n protected _alloc(size: number): any {\n this._buffer = this.resizeBufferArray(this._buffer, size);\n return this;\n }\n}\n\n/**\n * A data container that contains a string\n */\nclass StringDataArray extends BaseDataArray {\n constructor() {\n super(String, 0);\n this.size = 0;\n this._buffer = \"\";\n }\n /**\n * insert the content of a string into the StringDataArray\n * @param in_offset - the target index\n * @param in_string - the string to be inserted\n */\n insertRange(in_offset: number, in_string: string) {\n this._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(in_offset)}`;\n this.size = this.size + in_string.length;\n }\n\n /**\n * remove a range of elements from the string\n * @param in_offset - start of the range\n * @param in_deleteCount - number of elements to be removed\n */\n removeRange(in_offset: number, in_deleteCount: number) {\n if (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n this._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(in_offset + in_deleteCount)}`;\n this.size -= in_deleteCount;\n } else {\n throw Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n }\n }\n\n /**\n * Set this array values to be equal to in_string values\n * @param in_offset - The offset in this array to begin start\n * setting this arrays values to in_string values.\n * @param in_string - the input string\n */\n set(in_offset: number, in_string: string) {\n this._buffer =\n `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(in_offset + in_string.length)}`;\n }\n\n /**\n * Return a range of characters in the string.\n * @param in_idxStart - the starting index\n * @param in_idxEnd - the end index - this offset is exclusive\n * @returns the characters in the range\n */\n getValueRange(in_idxStart: number, in_idxEnd: number): string {\n if (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n throw new Error(\"Trying to access out of bounds!\");\n }\n return this._buffer.slice(in_idxStart, in_idxEnd);\n }\n\n get length() { return this._buffer.length; }\n}\n\n/**\n * A data container that can contain boolean type\n */\nclass BoolDataArray extends UniversalDataArray {\n /**\n * @param size - The initial size with which to allocate the array.\n */\n constructor(size: number) {\n super(Array, size);\n }\n\n /**\n * helper function to write and cast to boolean array values into another array at a given offset\n * @param array - target array\n * @param values - the values we need to write\n * @param offset - starting index in target array\n */\n private arraySetBool(array, values, offset = 0) {\n let index = 0;\n values.forEach(function(value) {\n array[index + offset] = !!(value as boolean);\n index++;\n });\n }\n\n /**\n * insert the content of an array into the DataArray\n * @param in_offset - the target index\n * @param in_array - the array to be inserted\n */\n insertRange(in_offset: number, in_array: any[]) {\n const toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n this._buffer.splice.call(this._buffer, ...([in_offset, 0].concat(toBeAdded)));\n this.size = this.size + in_array.length;\n }\n\n /**\n * Set this array values to be equal to in_array values\n * @param in_offset - An optional offset in this array to begin start\n * setting this arrays values to in_array values.\n * @param in_array - the input array\n */\n set(in_offset: number, in_array) {\n if (in_array instanceof ArrayBuffer || in_array instanceof Array || in_array instanceof this.getBufferCtor()) {\n this.arraySetBool(this._buffer, in_array, in_offset);\n } else if (in_array instanceof BaseDataArray) {\n this.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n } else {\n console.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n }\n }\n}\n\nexport {\n BaseDataArray,\n Float32DataArray,\n Float64DataArray,\n Int8DataArray,\n Int16DataArray,\n Int32DataArray,\n Uint8DataArray,\n Uint16DataArray,\n Uint32DataArray,\n UniversalDataArray,\n StringDataArray,\n BoolDataArray,\n};\n"]}
@@ -11,19 +11,19 @@
11
11
  * There are and there won't be set functions!
12
12
  * (see javascript String class)
13
13
  *
14
- * @param low - lower 32 bit
15
- * @param high - higher 32 bit
14
+ * @param low - Lower 32 bit
15
+ * @param high - Higher 32 bit
16
16
  */
17
17
  export declare class Integer64 {
18
18
  protected low: number;
19
19
  protected high: number;
20
20
  constructor(low?: number, high?: number);
21
21
  /**
22
- * @returns the higher 32 bit integer part
22
+ * @returns The higher 32 bit integer part
23
23
  */
24
24
  getValueHigh(): number;
25
25
  /**
26
- * @returns the lower 32 bit integer part
26
+ * @returns The lower 32 bit integer part
27
27
  */
28
28
  getValueLow(): number;
29
29
  protected _int64toString(isSigned: boolean, in_radix?: number): string;
@@ -1 +1 @@
1
- {"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IACN,SAAS,CAAC,GAAG;IAAM,SAAS,CAAC,IAAI;gBAAvB,GAAG,SAAI,EAAY,IAAI,SAAI;IAGjD;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAqBrE;AAwDD;;GAEG;AACH,qBAAa,KAAM,SAAQ,SAAS;IAChC,MAAM,CAAC,UAAU,cAAuB,MAAM,2BAG5C;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGtB;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACjC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGjB"}
1
+ {"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IACN,SAAS,CAAC,GAAG;IAAM,SAAS,CAAC,IAAI;gBAAvB,GAAG,SAAI,EAAY,IAAI,SAAI;IAGjD;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAqBrE;AAwDD;;GAEG;AACH,qBAAa,KAAM,SAAQ,SAAS;IAChC,MAAM,CAAC,UAAU,cAAuB,MAAM,2BAG5C;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGtB;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACjC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGjB"}
@@ -25,8 +25,8 @@ const { MSG } = constants_1.constants;
25
25
  * There are and there won't be set functions!
26
26
  * (see javascript String class)
27
27
  *
28
- * @param low - lower 32 bit
29
- * @param high - higher 32 bit
28
+ * @param low - Lower 32 bit
29
+ * @param high - Higher 32 bit
30
30
  */
31
31
  class Integer64 {
32
32
  constructor(low = 0, high = 0) {
@@ -34,13 +34,13 @@ class Integer64 {
34
34
  this.high = high;
35
35
  }
36
36
  /**
37
- * @returns the higher 32 bit integer part
37
+ * @returns The higher 32 bit integer part
38
38
  */
39
39
  getValueHigh() {
40
40
  return this.high;
41
41
  }
42
42
  /**
43
- * @returns the lower 32 bit integer part
43
+ * @returns The lower 32 bit integer part
44
44
  */
45
45
  getValueLow() {
46
46
  return this.low;
@@ -73,11 +73,11 @@ exports.Integer64 = Integer64;
73
73
  * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.
74
74
  * @param in_radix - An integer between 2 and 36 that represents the
75
75
  * radix (the base in mathematical numeral systems) of the above mentioned string.
76
- * @throws if in_string is not a string
77
- * @throws if in_radix is entered but is not a number between 2 and 36
78
- * @throws if the property is a Uint64 property and in_string is a negative number
79
- * @throws if in_string contains characters other than numbers
80
- * @returns low and high bits of Int64
76
+ * @throws If in_string is not a string
77
+ * @throws If in_radix is entered but is not a number between 2 and 36
78
+ * @throws If the property is a Uint64 property and in_string is a negative number
79
+ * @throws If in_string contains characters other than numbers
80
+ * @returns Low and high bits of Int64
81
81
  */
82
82
  function _stringToInt64(in_signed, in_string, in_radix = 10) {
83
83
  consoleUtils_1.ConsoleUtils.assert(lodash_1.default.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);
@@ -1 +1 @@
1
- {"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"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,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC,CAAC;AAWN;;GAEG;AACH,MAAa,MAAO,SAAQ,SAAS;IACjC,MAAM,CAAC,UAAU,CAAC,SAAiB,EAAE,QAAQ,GAAG,EAAE;QAC9C,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;IACjC,CAAC;IAED,KAAK;QACD,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,QAAQ,CAAC,KAAK;QACV,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;CACJ;AAbD,wBAaC","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 * A data representation class for 64 bit integer types.\n * This is necessary since js doesn't support 64bit\n * integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions!\n * (see javascript String class)\n *\n * @param low - lower 32 bit\n * @param high - higher 32 bit\n */\nexport class Integer64 {\n constructor(protected low = 0, protected high = 0) {\n }\n\n /**\n * @returns the higher 32 bit integer part\n */\n getValueHigh() {\n return this.high;\n }\n\n /**\n * @returns the lower 32 bit integer part\n */\n getValueLow() {\n return this.low;\n }\n\n protected _int64toString(isSigned: boolean, in_radix = 10): string {\n ConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n ConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n let high = this.getValueHigh();\n let low = this.getValueLow();\n let result = \"\";\n const sign = !!(isSigned && (high & 0x80000000)); // eslint-disable-line no-bitwise\n if (sign) {\n high = ~high; // eslint-disable-line no-bitwise\n low = BIT32 - low;\n }\n do {\n const mod = (high % in_radix) * BIT32 + low;\n high = Math.floor(high / in_radix);\n low = Math.floor(mod / in_radix);\n result = (mod % in_radix).toString(in_radix) + result;\n } while (high || low);\n\n return sign ? `-${result}` : result;\n }\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 * @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 * @returns low and high bits of Int64\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n ConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n const string = in_string.trim();\n\n ConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n ConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n let position = 0;\n let negative = false;\n let high = 0;\n let low = 0;\n if (string[0] === \"-\") {\n negative = true;\n position += 1;\n }\n\n ConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n while (position < string.length) {\n const digit = parseInt(string[position++], in_radix);\n if (isNaN(digit)) {\n throw new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n }\n low = low * in_radix + digit;\n high = high * in_radix + Math.floor(low / BIT32);\n low %= BIT32;\n }\n\n if (negative) {\n // eslint-disable-next-line no-bitwise\n high = ~high;\n if (low) {\n low = BIT32 - low;\n } else {\n high += 1;\n }\n }\n\n return [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n */\nexport class Int64 extends Integer64 {\n static fromString = function(in_string: string, radix = 10) {\n const [low, high] = _stringToInt64(true, in_string, radix);\n return new Int64(low, high);\n };\n\n clone() {\n return new Int64(this.low, this.high);\n }\n\n toString(radix = 10) {\n return this._int64toString(true, radix);\n }\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n */\nexport class Uint64 extends Integer64 {\n static fromString(in_string: string, in_radix = 10) {\n const [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n return new Uint64(low, high);\n }\n\n clone() {\n return new Uint64(this.low, this.high);\n }\n\n toString(radix) {\n return this._int64toString(false, radix);\n }\n}\n"]}
1
+ {"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;GAEG;AAEH,oDAAuB;AACvB,kDAA+C;AAC/C,4CAAyC;AAEzC,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,qBAAS,CAAC;AAE1B;;;;;;;;;;;GAWG;AACH,MAAa,SAAS;IAClB,YAAsB,MAAM,CAAC,EAAY,OAAO,CAAC;QAA3B,QAAG,GAAH,GAAG,CAAI;QAAY,SAAI,GAAJ,IAAI,CAAI;IACjD,CAAC;IAED;;OAEG;IACH,YAAY;QACR,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,WAAW;QACP,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAES,cAAc,CAAC,QAAiB,EAAE,QAAQ,GAAG,EAAE;QACrD,2BAA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AAC;IAED,QAAQ,CAAC,KAAK;QACV,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;CACJ;AAbD,wBAaC","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 * This is necessary since js doesn't support 64bit\n * integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions!\n * (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n */\nexport class Integer64 {\n constructor(protected low = 0, protected high = 0) {\n }\n\n /**\n * @returns The higher 32 bit integer part\n */\n getValueHigh() {\n return this.high;\n }\n\n /**\n * @returns The lower 32 bit integer part\n */\n getValueLow() {\n return this.low;\n }\n\n protected _int64toString(isSigned: boolean, in_radix = 10): string {\n ConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n ConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n let high = this.getValueHigh();\n let low = this.getValueLow();\n let result = \"\";\n const sign = !!(isSigned && (high & 0x80000000)); // eslint-disable-line no-bitwise\n if (sign) {\n high = ~high; // eslint-disable-line no-bitwise\n low = BIT32 - low;\n }\n do {\n const mod = (high % in_radix) * BIT32 + low;\n high = Math.floor(high / in_radix);\n low = Math.floor(mod / in_radix);\n result = (mod % in_radix).toString(in_radix) + result;\n } while (high || low);\n\n return sign ? `-${result}` : result;\n }\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 * @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 * @returns Low and high bits of Int64\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n ConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n const string = in_string.trim();\n\n ConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n ConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n let position = 0;\n let negative = false;\n let high = 0;\n let low = 0;\n if (string[0] === \"-\") {\n negative = true;\n position += 1;\n }\n\n ConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n while (position < string.length) {\n const digit = parseInt(string[position++], in_radix);\n if (isNaN(digit)) {\n throw new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n }\n low = low * in_radix + digit;\n high = high * in_radix + Math.floor(low / BIT32);\n low %= BIT32;\n }\n\n if (negative) {\n // eslint-disable-next-line no-bitwise\n high = ~high;\n if (low) {\n low = BIT32 - low;\n } else {\n high += 1;\n }\n }\n\n return [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n */\nexport class Int64 extends Integer64 {\n static fromString = function(in_string: string, radix = 10) {\n const [low, high] = _stringToInt64(true, in_string, radix);\n return new Int64(low, high);\n };\n\n clone() {\n return new Int64(this.low, this.high);\n }\n\n toString(radix = 10) {\n return this._int64toString(true, radix);\n }\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n */\nexport class Uint64 extends Integer64 {\n static fromString(in_string: string, in_radix = 10) {\n const [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n return new Uint64(low, high);\n }\n\n clone() {\n return new Uint64(this.low, this.high);\n }\n\n toString(radix) {\n return this._int64toString(false, radix);\n }\n}\n"]}
@@ -62,7 +62,7 @@ export declare class SortedCollection<T> extends Collection<T> {
62
62
  * 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
63
63
  * the item mapped by '7.0.1'
64
64
  * @param in_key - The key to check against in order to get the nearest next item
65
- * @returns The nearest next item
65
+ * @returns The nearest next item
66
66
  */
67
67
  getNearestNextItem(in_key: string): T | undefined;
68
68
  /**
@@ -115,7 +115,7 @@ class SortedCollection extends collection_1.Collection {
115
115
  * 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
116
116
  * the item mapped by '7.0.1'
117
117
  * @param in_key - The key to check against in order to get the nearest next item
118
- * @returns The nearest next item
118
+ * @returns The nearest next item
119
119
  */
120
120
  getNearestNextItem(in_key) {
121
121
  const closestNextIndex = this._binarySearchNearestIndex(this._sortedKeys, in_key.toString());
@@ -1 +1 @@
1
- {"version":3,"file":"sortedCollection.js","sourceRoot":"","sources":["../../src/datastructures/sortedCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;;GAGG;AAEH,oDAAuB;AACvB,6CAA0C;AAE1C,MAAa,gBAAoB,SAAQ,uBAAa;IAIlD;;;;;;OAMG;IACH,YAAY,OAAgB,EAAE,OAAQ;QAClC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAXpB,gBAAW,GAAa,EAAE,CAAC;QAC3B,wBAAmB,GAAsC,SAAS,CAAC;IAW3E,CAAC;IAED;;;;;;;OAOG;IACH,qBAAqB,CAAC,KAAwC;QAC1D,OAAO,CAAC,MAAM,CAAC,gBAAC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,yBAAyB,CAAC,CAAC;QAC/D,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACrC,CAAC;IAED;;;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CAAC,EAAE;YAC5B,OAAO,SAAS,CAAC;SACpB;aAAM;YACH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC;SAChE;IACL,CAAC;CACJ;AAhJD,4CAgJC","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 private _sortedKeys: string[] = [];\n private _comparisonFunction?: (x: string, y: string) => number = undefined;\n\n /**\n * A sorted collection class.\n * @param in_name - a friendly name to describe this collection. If undefined\n * the collection will have a default \"Untitled Collection\" assigned to its name.\n * @param in_type - optional parameter pointing to the constructor\n * of a type this Collection will host.\n */\n constructor(in_name?: string, in_type?) {\n super(in_name, in_type);\n }\n\n /**\n * Set the comparison function. By default the keys will be sorted wrt their ASCII code.\n * @param in_fn - The function to compare two entries.\n * the return value of this function must convey to the following cases:\n * - if a \\> b, then the return value must be greater than 0\n * - if a \\< b, then the return value must be less than 0\n * - if a == b, then the return value must be 0\n */\n setComparisonFunction(in_fn?: (x: string, y: string) => number) {\n console.assert(_.isFunction(in_fn), \"Must provide a function\");\n this._comparisonFunction = in_fn;\n }\n\n /**\n * Add an item to the collection. Sort the list of keys in an ascending order.\n * @param in_key - Key to store the value under\n * @param in_value - Value to store in the collection\n * @returns Return the value passed in\n */\n add(in_key: string | number, in_value: T) {\n const toReturn = super.add(in_key, in_value);\n\n this._sortedKeys.push(in_key.toString());\n this._sortedKeys.sort(this._comparisonFunction);\n\n return toReturn;\n }\n\n /**\n * Remove an item from this Collection. This method returns a Boolean indicating\n * the success or failure of the removal. This is practical because if we were\n * to throw an error when the key doesn't exist, it would require additional\n * checks by the caller to make sure this key exists prior to removal. Which\n * would make the attempt of removal more verbose and also costly because the\n * caller would have to keep a list – somewhere else – of the things he can\n * and cannot remove.\n *\n * @param in_key - the key we wish to remove\n * @returns true if the key exists and was removed, false otherwise.\n */\n remove(in_key: string) {\n const toReturn = super.remove(in_key);\n this._sortedKeys = _.without(this._sortedKeys, in_key);\n return toReturn;\n }\n\n /**\n * Copy the items of in_collection to this collection.\n * @returns cloned SortedCollection\n */\n clone(): SortedCollection<T> {\n const newCol = new SortedCollection<T>(this._name, this._type);\n newCol.setComparisonFunction(this._comparisonFunction);\n newCol.bulkAdd(this._items);\n return newCol;\n }\n\n /**\n * Internal function use to search (binary search) for the nearest index that\n * the given key would be inserted.\n * i.e. given the array [10, 20, 30, 40, 50] the index that 35 should be inserted at is 3\n * @param in_array - Target array\n * @param in_key - Key to check against\n * @returns The index at which the key would be inserted in\n */\n private _binarySearchNearestIndex(in_array: string[], in_key: string): number {\n if (this._comparisonFunction === undefined) {\n return _.sortedIndex(in_array, in_key);\n } else {\n const middleIndex = Math.floor((in_array.length - 1) / 2);\n\n if (middleIndex < 0) {\n return 0;\n }\n\n if (this._comparisonFunction(in_array[middleIndex], in_key) > 0) {\n if (in_array.length === 1) {\n return 0;\n }\n\n return this._binarySearchNearestIndex(in_array.slice(0, middleIndex), in_key);\n }\n\n if (this._comparisonFunction(in_array[middleIndex], in_key) < 0) {\n if (in_array.length === 1) {\n return 1;\n }\n\n return (middleIndex + 1) + this._binarySearchNearestIndex(\n in_array.slice(middleIndex + 1, in_array.length),\n in_key,\n );\n }\n\n return middleIndex;\n }\n }\n\n /**\n * Return the nearest next item to the given key i.e.\n * 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 * the item mapped by '7.0.1'\n * @param in_key - The key to check against in order to get the nearest next item\n * @returns The nearest next item\n */\n getNearestNextItem(in_key: string) {\n const closestNextIndex = this._binarySearchNearestIndex(this._sortedKeys, in_key.toString());\n if (closestNextIndex === this.getCount()) {\n return undefined;\n } else {\n return this.item(this._sortedKeys[closestNextIndex]);\n }\n }\n\n /**\n * Return the nearest previous item to the given key i.e.\n * 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 * the item mapped by '7.0.1'\n * @param in_key - The key to check against in order to get the nearest previous item\n * @returns The nearest previous item\n */\n getNearestPreviousItem(in_key: string | number) {\n const closestPreviousIndex = this._binarySearchNearestIndex(this._sortedKeys, in_key.toString());\n if (closestPreviousIndex === 0) {\n return undefined;\n } else {\n return this.item(this._sortedKeys[closestPreviousIndex - 1]);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"sortedCollection.js","sourceRoot":"","sources":["../../src/datastructures/sortedCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;;GAGG;AAEH,oDAAuB;AACvB,6CAA0C;AAE1C,MAAa,gBAAoB,SAAQ,uBAAa;IAIlD;;;;;;OAMG;IACH,YAAY,OAAgB,EAAE,OAAQ;QAClC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAXpB,gBAAW,GAAa,EAAE,CAAC;QAC3B,wBAAmB,GAAsC,SAAS,CAAC;IAW3E,CAAC;IAED;;;;;;;OAOG;IACH,qBAAqB,CAAC,KAAwC;QAC1D,OAAO,CAAC,MAAM,CAAC,gBAAC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,yBAAyB,CAAC,CAAC;QAC/D,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,MAAuB,EAAE,QAAW;QACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE7C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAEhD,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;;;;;;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AQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE;gBAC7D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;oBACvB,OAAO,CAAC,CAAC;iBACZ;gBAED,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,yBAAyB,CACrD,QAAQ,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,EAChD,MAAM,CACT,CAAC;aACL;YAED,OAAO,WAAW,CAAC;SACtB;IACL,CAAC;IAED;;;;;;OAMG;IACH,kBAAkB,CAAC,MAAc;QAC7B,MAAM,gBAAgB,GAAG,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC7F,IAAI,gBAAgB,KAAK,IAAI,CAAC,QAAQ,EAAE,EAAE;YACtC,OAAO,SAAS,CAAC;SACpB;aAAM;YACH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC;SACxD;IACL,CAAC;IAED;;;;;;OAMG;IACH,sBAAsB,CAAC,MAAuB;QAC1C,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjG,IAAI,oBAAoB,KAAK,CAAC,EAAE;YAC5B,OAAO,SAAS,CAAC;SACpB;aAAM;YACH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC;SAChE;IACL,CAAC;CACJ;AAhJD,4CAgJC","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 private _sortedKeys: string[] = [];\n private _comparisonFunction?: (x: string, y: string) => number = undefined;\n\n /**\n * A sorted collection class.\n * @param in_name - a friendly name to describe this collection. If undefined\n * the collection will have a default \"Untitled Collection\" assigned to its name.\n * @param in_type - optional parameter pointing to the constructor\n * of a type this Collection will host.\n */\n constructor(in_name?: string, in_type?) {\n super(in_name, in_type);\n }\n\n /**\n * Set the comparison function. By default the keys will be sorted wrt their ASCII code.\n * @param in_fn - The function to compare two entries.\n * the return value of this function must convey to the following cases:\n * - if a \\> b, then the return value must be greater than 0\n * - if a \\< b, then the return value must be less than 0\n * - if a == b, then the return value must be 0\n */\n setComparisonFunction(in_fn?: (x: string, y: string) => number) {\n console.assert(_.isFunction(in_fn), \"Must provide a function\");\n this._comparisonFunction = in_fn;\n }\n\n /**\n * Add an item to the collection. Sort the list of keys in an ascending order.\n * @param in_key - Key to store the value under\n * @param in_value - Value to store in the collection\n * @returns Return the value passed in\n */\n add(in_key: string | number, in_value: T) {\n const toReturn = super.add(in_key, in_value);\n\n this._sortedKeys.push(in_key.toString());\n this._sortedKeys.sort(this._comparisonFunction);\n\n return toReturn;\n }\n\n /**\n * Remove an item from this Collection. This method returns a Boolean indicating\n * the success or failure of the removal. This is practical because if we were\n * to throw an error when the key doesn't exist, it would require additional\n * checks by the caller to make sure this key exists prior to removal. Which\n * would make the attempt of removal more verbose and also costly because the\n * caller would have to keep a list – somewhere else – of the things he can\n * and cannot remove.\n *\n * @param in_key - the key we wish to remove\n * @returns true if the key exists and was removed, false otherwise.\n */\n remove(in_key: string) {\n const toReturn = super.remove(in_key);\n this._sortedKeys = _.without(this._sortedKeys, in_key);\n return toReturn;\n }\n\n /**\n * Copy the items of in_collection to this collection.\n * @returns cloned SortedCollection\n */\n clone(): SortedCollection<T> {\n const newCol = new SortedCollection<T>(this._name, this._type);\n newCol.setComparisonFunction(this._comparisonFunction);\n newCol.bulkAdd(this._items);\n return newCol;\n }\n\n /**\n * Internal function use to search (binary search) for the nearest index that\n * the given key would be inserted.\n * i.e. given the array [10, 20, 30, 40, 50] the index that 35 should be inserted at is 3\n * @param in_array - Target array\n * @param in_key - Key to check against\n * @returns The index at which the key would be inserted in\n */\n private _binarySearchNearestIndex(in_array: string[], in_key: string): number {\n if (this._comparisonFunction === undefined) {\n return _.sortedIndex(in_array, in_key);\n } else {\n const middleIndex = Math.floor((in_array.length - 1) / 2);\n\n if (middleIndex < 0) {\n return 0;\n }\n\n if (this._comparisonFunction(in_array[middleIndex], in_key) > 0) {\n if (in_array.length === 1) {\n return 0;\n }\n\n return this._binarySearchNearestIndex(in_array.slice(0, middleIndex), in_key);\n }\n\n if (this._comparisonFunction(in_array[middleIndex], in_key) < 0) {\n if (in_array.length === 1) {\n return 1;\n }\n\n return (middleIndex + 1) + this._binarySearchNearestIndex(\n in_array.slice(middleIndex + 1, in_array.length),\n in_key,\n );\n }\n\n return middleIndex;\n }\n }\n\n /**\n * Return the nearest next item to the given key i.e.\n * 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 * the item mapped by '7.0.1'\n * @param in_key - The key to check against in order to get the nearest next item\n * @returns The nearest next item\n */\n getNearestNextItem(in_key: string) {\n const closestNextIndex = this._binarySearchNearestIndex(this._sortedKeys, in_key.toString());\n if (closestNextIndex === this.getCount()) {\n return undefined;\n } else {\n return this.item(this._sortedKeys[closestNextIndex]);\n }\n }\n\n /**\n * Return the nearest previous item to the given key i.e.\n * 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 * the item mapped by '7.0.1'\n * @param in_key - The key to check against in order to get the nearest previous item\n * @returns The nearest previous item\n */\n getNearestPreviousItem(in_key: string | number) {\n const closestPreviousIndex = this._binarySearchNearestIndex(this._sortedKeys, in_key.toString());\n if (closestPreviousIndex === 0) {\n return undefined;\n } else {\n return this.item(this._sortedKeys[closestPreviousIndex - 1]);\n }\n }\n}\n"]}
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.FlaggedError = void 0;
8
8
  /**
9
9
  * Checks if a flag is set
10
- * @param flags - flags set within an error object
11
- * @param flag - A flag to be checked
12
- * @returns True if the flag is set in passed flags, false otherwise.
10
+ * @param flags - Flags set within an error object
11
+ * @param flag - A flag to be checked
12
+ * @returns True if the flag is set in passed flags, false otherwise.
13
13
  */
14
14
  const _isFlagSet = (flags, flag) => {
15
15
  // eslint-disable-next-line no-bitwise
@@ -1 +1 @@
1
- {"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AACF,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAChD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AACnC,CAAC,CAAC;AAEF,MAAa,YAAY;IAAzB;QAec,UAAK,GAAW,CAAC,CAAC;IAehC,CAAC;IAbG;;OAEG;IACH,OAAO;QACH,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,WAAW;QACP,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;;AA7BL,oCA8BC;AA7BG;;GAEG;AACI,kBAAK,GAAG;IACX;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACX,CAAC","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 */\n const _isFlagSet = (flags: number, flag: number) => {\n // eslint-disable-next-line no-bitwise\n return (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n /**\n * Flags that may be set on an error instance.\n */\n static FLAGS = {\n /**\n * A transient error results from an operation that could succeed if retried.\n */\n TRANSIENT: 1,\n /**\n * A quiet error should not trigger an error log.\n */\n QUIET: 2,\n };\n\n protected flags: number = 0;\n\n /**\n * @returns True if the quiet flag is set.\n */\n isQuiet(): boolean {\n return _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n }\n\n /**\n * @returns True if the transient flag is set.\n */\n isTransient(): boolean {\n return _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n }\n}\n"]}
1
+ {"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AACF,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAChD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AACnC,CAAC,CAAC;AAEF,MAAa,YAAY;IAAzB;QAec,UAAK,GAAW,CAAC,CAAC;IAehC,CAAC;IAbG;;OAEG;IACH,OAAO;QACH,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,WAAW;QACP,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;;AA7BL,oCA8BC;AA7BG;;GAEG;AACI,kBAAK,GAAG;IACX;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACX,CAAC","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 */\n const _isFlagSet = (flags: number, flag: number) => {\n // eslint-disable-next-line no-bitwise\n return (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n /**\n * Flags that may be set on an error instance.\n */\n static FLAGS = {\n /**\n * A transient error results from an operation that could succeed if retried.\n */\n TRANSIENT: 1,\n /**\n * A quiet error should not trigger an error log.\n */\n QUIET: 2,\n };\n\n protected flags: number = 0;\n\n /**\n * @returns True if the quiet flag is set.\n */\n isQuiet(): boolean {\n return _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n }\n\n /**\n * @returns True if the transient flag is set.\n */\n isTransient(): boolean {\n return _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2TH,eAAO,MAAM,SAAS;mCAtKwB,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,WAAU,OAAO,KAAW,MAAM;8BA4B1E,MAAM,WAAU,WAAW,KAAwB,WAAW;8BAsBtE,MAAM;8BASN,MAAM;;wCAaQ,MAAM;sBAwB5B,MAAM;6BA0DS,MAAM,YAAY,MAAM,uBAAmB,MAAM;qCA/C1E,WAAW,aACX,WAAW,0CAEvB,WAAW;CAkEb,CAAC"}
1
+ {"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0TH,eAAO,MAAM,SAAS;mCAtKwB,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,WAAU,OAAO,KAAW,MAAM;8BA4B1E,MAAM,WAAU,WAAW,KAAwB,WAAW;8BAsBtE,MAAM;8BASN,MAAM;;wCAaQ,MAAM;sBAwB5B,MAAM;6BA0DS,MAAM,YAAY,MAAM,uBAAmB,MAAM;qCA/C1E,WAAW,aACX,WAAW,0CAEvB,WAAW;CAkEb,CAAC"}
package/dist/guidUtils.js CHANGED
@@ -38,9 +38,8 @@ const guidRNG = {
38
38
  * local time and Math.random() is used.
39
39
  * @param in_enforceReInitialization - Optionally enforce re-initialization with another seed
40
40
  *
41
- * @returns The seed used to initialize the RNG;
42
- * If re-initialization is not enforced,
43
- * a zero indicates that the RNG was not re-seeded.
41
+ * @returns The seed used to initialize the RNG;
42
+ * If re-initialization is not enforced, a zero indicates that the RNG was not re-seeded.
44
43
  * @alias property-common.initializeGUIDGenerator
45
44
  */
46
45
  initialize(in_seed, in_enforceReInitialization = false) {
@@ -1 +1 @@
1
- {"version":3,"file":"guidUtils.js","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,+BAA+B;AAE/B;;GAEG;AAEH,0DAAiC;AACjC,8DAAkE;AAClE,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,OAAO,GAAG;IACZ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,aAAa,EAAE,KAAK;IAEpB;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,OAAgB,EAAE,6BAAsC,KAAK;QACpE,6DAA6D;QAC7D,sDAAsD;QACtD,IAAI,IAAI,CAAC,aAAa,IAAI,CAAC,0BAA0B,EAAE;YACnD,OAAO,CAAC,CAAC;SACZ;aAAM;YACH,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAE1B,IAAI,OAAO,KAAK,SAAS,EAAE;gBACvB,MAAM,YAAY,GAAG,IAAA,8CAAyB,EAAC,CAAC,CAAC,CAAC;gBAClD,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;gBACzB,IAAI,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;gBACzB,IAAI,CAAC,EAAE,GAAG,YA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disable no-bitwise */\n\n/**\n * @fileoverview Utility functions related to handling GUIDs\n */\n\nimport base64js from \"base64-js\";\nimport { generateRandomUInt32Array } from \"../platform-dependent\";\nconst UINT_32HASH_PRIME = 16777619;\n\n/**\n * Fast high quality 32 bit RNG for consistent guid.\n *\n * Good \"randomness\" (distribution); Period is approximately equal to 3.11*10^37\n * Implementation was take from \"Numerical recipes. The Art of Scientific Computing.\", 3rd edition.\n * Page 357, algorithm name: Ranlim32\n *\n */\nconst guidRNG = {\n u: 0,\n v: 0,\n w1: 0,\n w2: 0,\n isInitialized: false,\n\n /**\n * Initialize RNG.\n * This function need to be called once, before the first guid gets created.\n *\n * @param in_seed - Optional 32-bit seed for guid RNG;\n * If no seed is given, a combination of system's\n * local time and Math.random() is used.\n * @param in_enforceReInitialization - Optionally enforce re-initialization with another seed\n *\n * @returns The seed used to initialize the RNG;\n * If re-initialization is not enforced,\n * a zero indicates that the RNG was not re-seeded.\n * @alias property-common.initializeGUIDGenerator\n */\n initialize(in_seed?: number, in_enforceReInitialization: boolean = false): number {\n // Quit if the RNG has already been initialized and we do not\n // want to enforce a re-initialization with a new seed\n if (this.isInitialized && !in_enforceReInitialization) {\n return 0;\n } else {\n this.isInitialized = true;\n\n if (in_seed === undefined) {\n const randomValues = generateRandomUInt32Array(4);\n this.u = randomValues[0];\n this.v = randomValues[1];\n this.w1 = randomValues[2];\n this.w2 = randomValues[3];\n } else {\n this.v = 224461437;\n this.w1 = 521288629;\n this.w2 = 362436069;\n\n this.u = in_seed ^ this.v;\n this.genRandUInt32();\n this.v = this.u;\n this.genRandUInt32();\n }\n return -1;\n }\n },\n\n /**\n * @returns 32-bit random number based on the RNGs internal state\n */\n genRandUInt32(): number {\n this.u = multiply_uint32(this.u, 2891336453) + 1640531513;\n this.v ^= this.v >>> 13;\n this.v ^= this.v << 17;\n this.v = ((this.v >>> 5) ^ this.v) >>> 0;\n\n this.w1 = multiply_uint32(33378, (this.w1 & 0xffff)) + (this.w1 >>> 16);\n this.w2 = multiply_uint32(57225, (this.w2 & 0xffff)) + (this.w2 >>> 16);\n\n let x = this.u ^ (this.u << 9);\n x ^= x >>> 17;\n x ^= x << 6;\n\n let y = this.w1 ^ (this.w1 << 17);\n y ^= y >>> 15;\n y ^= y << 5;\n return (((x >>> 0) + this.v) ^ ((y >>> 0) + this.w2)) >>> 0;\n },\n};\n\n/**\n * Check if guid is base64 based on the length\n * The length of base16 guid is 36, base64 - 22\n *\n * @param guid - Input guid\n * @returns True if guid is base64\n */\nconst isBase64 = (guid: string): boolean => guid.length === 22;\n\n/**\n * Allows for 32-bit integer multiplication with C-like semantics\n *\n * @param a - unsigned int32 value\n * @param b - unsigned int32 value\n * @returns - result of unsigned integer multiplication\n */\nfunction multiply_uint32(a: number, b: number): number {\n let n = a;\n let m = b;\n\n n >>>= 0;\n m >>>= 0;\n const nlo = n & 0xffff;\n return (((n - nlo) * m >>> 0) + (nlo * m)) >>> 0;\n}\n\n/**\n * Helper function to convert base64 encoding to url friendly format\n *\n * @param base64 - Base64 string\n *\n * @returns Url-friendly base64 encoding.\n */\nconst toUrlBase64 = (base64: string): string => base64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").split(\"=\")[0];\n\n/**\n * Helper function to recover padding of base64 encoding\n *\n * @param x - Base64 string\n *\n * @returns Padded base64 encoding.\n */\nconst toPaddedBase64 = function(x: string): string {\n let base64 = x;\n const padLength = 4 - base64.length % 4;\n base64 += \"=\".repeat(padLength);\n return base64;\n};\n\n/**\n * Helper function to create a guid string from an array with 32Bit values\n *\n * @param in_guidArray - Array with the 32 bit values\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The guid\n */\nconst uint32x4ToGUID = function(in_guidArray: Uint32Array | Int32Array | number[], base64: boolean = false): string {\n if (base64) {\n const intArray = new Uint32Array(in_guidArray);\n const byteArray = new Uint8Array(intArray.buffer);\n const base64guid = base64js.fromByteArray(byteArray);\n // return url-friendly base64\n return toUrlBase64(base64guid);\n } else {\n // Convert to hexadecimal string\n let str = \"\";\n for (let i = 0; i < 4; i++) {\n const hex = in_guidArray[i].toString(16);\n str += (\"0\".repeat(8 - hex.length) + hex);\n }\n // eslint-disable-next-line max-len\n return `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(16, 4)}-${str.substr(20, 12)}`;\n }\n};\n\n/**\n * Convert guid to four 32Bit values.\n *\n * @param in_guid - The guid to convert\n * @param io_result - An optional array to write the result to;\n * If no array is given, a new one gets created\n * @returns Four 32-bit values\n *\n */\nconst guidToUint32x4 = function(in_guid: string, result: Uint32Array = new Uint32Array(4)): Uint32Array {\n if (isBase64(in_guid)) {\n const guid = toPaddedBase64(in_guid);\n const bytes = base64js.toByteArray(guid);\n const intArray = new Uint32Array(bytes.buffer);\n result.set(intArray);\n } else {\n result[0] = parseInt(`0x${in_guid.substr(0, 8)}`, 16);\n result[1] = parseInt(`0x${in_guid.substr(9, 4)}${in_guid.substr(14, 4)}`, 16);\n result[2] = parseInt(`0x${in_guid.substr(19, 4)}${in_guid.substr(24, 4)}`, 16);\n result[3] = parseInt(`0x${in_guid.substr(28, 8)}`, 16);\n }\n return result;\n};\n\n/**\n * Convert base64 guid into base16.\n *\n * @param in_guid - Base64 guid to convert\n * @returns Base16 guid\n *\n */\nconst base64Tobase16 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid));\n\n/**\n * Convert base16 into base64 guid.\n *\n * @param in_guid - Base16 guid to convert\n * @returns Base64 guid\n *\n */\nconst base16ToBase64 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid), true);\n\n/**\n * Based on the boolean parameter generate either\n * a 128 bit base16 guid with the following format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\n * or url-friendly base64 string guid of length 22\n *\n * This function is *not* thread safe!\n *\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The guid\n */\nconst generateGUID = function(base64 = false): string {\n const rnds = new Uint32Array(4);\n\n // Random numbers for guid (4x32 bit)\n rnds[0] = guidRNG.genRandUInt32();\n rnds[1] = guidRNG.genRandUInt32();\n rnds[2] = guidRNG.genRandUInt32();\n rnds[3] = guidRNG.genRandUInt32();\n return uint32x4ToGUID(rnds, base64);\n};\n\n// The last character is checked this way because last 4 bits of 22nd character are ignored\n// by decoder, e.g. \"+Q\" and \"+Z\" result in the same decoding.\n// The only characters with last 4 bits set to 0 are A, Q, g, w.\nconst reBase64 = (/^[\\w-]{21}[AQgw]$/);\n// eslint-disable-next-line unicorn/no-unsafe-regex\nconst reBase16 = (/^[\\dA-Fa-f]{8}(?:-[\\dA-Fa-f]{4}){3}-[\\dA-Fa-f]{12}$/);\n\n/**\n * Routine used to check whether the given string is a valid guid\n *\n * @param in_guid - The guid to test.\n * @returns True if the parameter is a valid guid, false otherwise.\n */\nconst isGUID = (in_guid: string) => reBase16.test(in_guid) || reBase64.test(in_guid);\n\n/**\n * Performs a hash combination operation on the two supplied Uint32 arrays of length 4 (using\n * a variant of the algorithm from boost::hash_combine\n *\n * @param in_array1 - First array\n * @param in_array2 - Second array\n * @returns New combined hash\n */\nconst hashCombine4xUint32 = function(\n in_array1: Uint32Array,\n in_array2: Uint32Array,\n io_result?: Uint32Array,\n): Uint32Array {\n let accumulated = io_result;\n if (accumulated === undefined) {\n accumulated = new Uint32Array(in_array2);\n } else {\n accumulated[0] = in_array2[0];\n accumulated[1] = in_array2[1];\n accumulated[2] = in_array2[2];\n accumulated[3] = in_array2[3];\n }\n\n accumulated[0] += 0x9e3779b9;\n accumulated[1] += 0x638f227;\n accumulated[2] += 0x1aff2bad;\n accumulated[3] += 0x3a8f05c5;\n\n accumulated[0] += in_array1[3] << 6;\n accumulated[1] += in_array1[0] << 6;\n accumulated[2] += in_array1[1] << 6;\n accumulated[3] += in_array1[2] << 6;\n\n accumulated[0] += in_array1[2] >> 2;\n accumulated[1] += in_array1[3] >> 2;\n accumulated[2] += in_array1[0] >> 2;\n accumulated[3] += in_array1[1] >> 2;\n\n accumulated[0] = ((accumulated[0] ^ in_array1[1]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[1] = ((accumulated[1] ^ in_array1[2]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[2] = ((accumulated[2] ^ in_array1[3]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[3] = ((accumulated[3] ^ in_array1[0]) * UINT_32HASH_PRIME) >>> 0;\n\n return accumulated;\n};\n\n/**\n * Takes two guids and generates a new derived guid.\n * Note: You should only use this helper function when you need only one combination.\n * Otherwise, it is more efficient to work on the uint8 arrays directly.\n *\n * @param in_guid1 - Input guid\n * @param in_guid2 - Input guid\n * @param base64 - Use base64 encoding instead of standart guids\n * @returns Combined guid\n */\nconst combineGuids = function(in_guid1: string, in_guid2: string, base64 = false): string {\n const firstArray = guidToUint32x4(in_guid1);\n const secondArray = guidToUint32x4(in_guid2);\n const combined = hashCombine4xUint32(firstArray, secondArray);\n return uint32x4ToGUID(combined, base64);\n};\n\n// Make sure the RNG is initialized\nguidRNG.initialize();\n\nconst initializeGUIDGenerator = (...args) => { guidRNG.initialize(...args); };\n\nexport const GuidUtils = {\n uint32x4ToGUID,\n guidToUint32x4,\n base64Tobase16,\n base16ToBase64,\n initializeGUIDGenerator,\n generateGUID,\n isGUID,\n combineGuids,\n hashCombine4xUint32,\n};\n"]}
1
+ {"version":3,"file":"guidUtils.js","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,+BAA+B;AAE/B;;GAEG;AAEH,0DAAiC;AACjC,8DAAkE;AAClE,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,OAAO,GAAG;IACZ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,aAAa,EAAE,KAAK;IAEpB;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,OAAgB,EAAE,6BAAsC,KAAK;QACpE,6DAA6D;QA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EF,mCAAmC;AACnC,OAAO,CAAC,UAAU,EAAE,CAAC;AAErB,MAAM,uBAAuB,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjE,QAAA,SAAS,GAAG;IACrB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,uBAAuB;IACvB,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,mBAAmB;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\n/**\n * @fileoverview Utility functions related to handling GUIDs\n */\n\nimport base64js from \"base64-js\";\nimport { generateRandomUInt32Array } from \"../platform-dependent\";\nconst UINT_32HASH_PRIME = 16777619;\n\n/**\n * Fast high quality 32 bit RNG for consistent guid.\n *\n * Good \"randomness\" (distribution); Period is approximately equal to 3.11*10^37\n * Implementation was take from \"Numerical recipes. The Art of Scientific Computing.\", 3rd edition.\n * Page 357, algorithm name: Ranlim32\n *\n */\nconst guidRNG = {\n u: 0,\n v: 0,\n w1: 0,\n w2: 0,\n isInitialized: false,\n\n /**\n * Initialize RNG.\n * This function need to be called once, before the first guid gets created.\n *\n * @param in_seed - Optional 32-bit seed for guid RNG;\n * If no seed is given, a combination of system's\n * local time and Math.random() is used.\n * @param in_enforceReInitialization - Optionally enforce re-initialization with another seed\n *\n * @returns The seed used to initialize the RNG;\n * If re-initialization is not enforced, a zero indicates that the RNG was not re-seeded.\n * @alias property-common.initializeGUIDGenerator\n */\n initialize(in_seed?: number, in_enforceReInitialization: boolean = false): number {\n // Quit if the RNG has already been initialized and we do not\n // want to enforce a re-initialization with a new seed\n if (this.isInitialized && !in_enforceReInitialization) {\n return 0;\n } else {\n this.isInitialized = true;\n\n if (in_seed === undefined) {\n const randomValues = generateRandomUInt32Array(4);\n this.u = randomValues[0];\n this.v = randomValues[1];\n this.w1 = randomValues[2];\n this.w2 = randomValues[3];\n } else {\n this.v = 224461437;\n this.w1 = 521288629;\n this.w2 = 362436069;\n\n this.u = in_seed ^ this.v;\n this.genRandUInt32();\n this.v = this.u;\n this.genRandUInt32();\n }\n return -1;\n }\n },\n\n /**\n * @returns 32-bit random number based on the RNGs internal state\n */\n genRandUInt32(): number {\n this.u = multiply_uint32(this.u, 2891336453) + 1640531513;\n this.v ^= this.v >>> 13;\n this.v ^= this.v << 17;\n this.v = ((this.v >>> 5) ^ this.v) >>> 0;\n\n this.w1 = multiply_uint32(33378, (this.w1 & 0xffff)) + (this.w1 >>> 16);\n this.w2 = multiply_uint32(57225, (this.w2 & 0xffff)) + (this.w2 >>> 16);\n\n let x = this.u ^ (this.u << 9);\n x ^= x >>> 17;\n x ^= x << 6;\n\n let y = this.w1 ^ (this.w1 << 17);\n y ^= y >>> 15;\n y ^= y << 5;\n return (((x >>> 0) + this.v) ^ ((y >>> 0) + this.w2)) >>> 0;\n },\n};\n\n/**\n * Check if guid is base64 based on the length\n * The length of base16 guid is 36, base64 - 22\n *\n * @param guid - Input guid\n * @returns True if guid is base64\n */\nconst isBase64 = (guid: string): boolean => guid.length === 22;\n\n/**\n * Allows for 32-bit integer multiplication with C-like semantics\n *\n * @param a - unsigned int32 value\n * @param b - unsigned int32 value\n * @returns - result of unsigned integer multiplication\n */\nfunction multiply_uint32(a: number, b: number): number {\n let n = a;\n let m = b;\n\n n >>>= 0;\n m >>>= 0;\n const nlo = n & 0xffff;\n return (((n - nlo) * m >>> 0) + (nlo * m)) >>> 0;\n}\n\n/**\n * Helper function to convert base64 encoding to url friendly format\n *\n * @param base64 - Base64 string\n *\n * @returns Url-friendly base64 encoding.\n */\nconst toUrlBase64 = (base64: string): string => base64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").split(\"=\")[0];\n\n/**\n * Helper function to recover padding of base64 encoding\n *\n * @param x - Base64 string\n *\n * @returns Padded base64 encoding.\n */\nconst toPaddedBase64 = function(x: string): string {\n let base64 = x;\n const padLength = 4 - base64.length % 4;\n base64 += \"=\".repeat(padLength);\n return base64;\n};\n\n/**\n * Helper function to create a guid string from an array with 32Bit values\n *\n * @param in_guidArray - Array with the 32 bit values\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The guid\n */\nconst uint32x4ToGUID = function(in_guidArray: Uint32Array | Int32Array | number[], base64: boolean = false): string {\n if (base64) {\n const intArray = new Uint32Array(in_guidArray);\n const byteArray = new Uint8Array(intArray.buffer);\n const base64guid = base64js.fromByteArray(byteArray);\n // return url-friendly base64\n return toUrlBase64(base64guid);\n } else {\n // Convert to hexadecimal string\n let str = \"\";\n for (let i = 0; i < 4; i++) {\n const hex = in_guidArray[i].toString(16);\n str += (\"0\".repeat(8 - hex.length) + hex);\n }\n // eslint-disable-next-line max-len\n return `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(16, 4)}-${str.substr(20, 12)}`;\n }\n};\n\n/**\n * Convert guid to four 32Bit values.\n *\n * @param in_guid - The guid to convert\n * @param io_result - An optional array to write the result to;\n * If no array is given, a new one gets created\n * @returns Four 32-bit values\n *\n */\nconst guidToUint32x4 = function(in_guid: string, result: Uint32Array = new Uint32Array(4)): Uint32Array {\n if (isBase64(in_guid)) {\n const guid = toPaddedBase64(in_guid);\n const bytes = base64js.toByteArray(guid);\n const intArray = new Uint32Array(bytes.buffer);\n result.set(intArray);\n } else {\n result[0] = parseInt(`0x${in_guid.substr(0, 8)}`, 16);\n result[1] = parseInt(`0x${in_guid.substr(9, 4)}${in_guid.substr(14, 4)}`, 16);\n result[2] = parseInt(`0x${in_guid.substr(19, 4)}${in_guid.substr(24, 4)}`, 16);\n result[3] = parseInt(`0x${in_guid.substr(28, 8)}`, 16);\n }\n return result;\n};\n\n/**\n * Convert base64 guid into base16.\n *\n * @param in_guid - Base64 guid to convert\n * @returns Base16 guid\n *\n */\nconst base64Tobase16 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid));\n\n/**\n * Convert base16 into base64 guid.\n *\n * @param in_guid - Base16 guid to convert\n * @returns Base64 guid\n *\n */\nconst base16ToBase64 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid), true);\n\n/**\n * Based on the boolean parameter generate either\n * a 128 bit base16 guid with the following format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\n * or url-friendly base64 string guid of length 22\n *\n * This function is *not* thread safe!\n *\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The guid\n */\nconst generateGUID = function(base64 = false): string {\n const rnds = new Uint32Array(4);\n\n // Random numbers for guid (4x32 bit)\n rnds[0] = guidRNG.genRandUInt32();\n rnds[1] = guidRNG.genRandUInt32();\n rnds[2] = guidRNG.genRandUInt32();\n rnds[3] = guidRNG.genRandUInt32();\n return uint32x4ToGUID(rnds, base64);\n};\n\n// The last character is checked this way because last 4 bits of 22nd character are ignored\n// by decoder, e.g. \"+Q\" and \"+Z\" result in the same decoding.\n// The only characters with last 4 bits set to 0 are A, Q, g, w.\nconst reBase64 = (/^[\\w-]{21}[AQgw]$/);\n// eslint-disable-next-line unicorn/no-unsafe-regex\nconst reBase16 = (/^[\\dA-Fa-f]{8}(?:-[\\dA-Fa-f]{4}){3}-[\\dA-Fa-f]{12}$/);\n\n/**\n * Routine used to check whether the given string is a valid guid\n *\n * @param in_guid - The guid to test.\n * @returns True if the parameter is a valid guid, false otherwise.\n */\nconst isGUID = (in_guid: string) => reBase16.test(in_guid) || reBase64.test(in_guid);\n\n/**\n * Performs a hash combination operation on the two supplied Uint32 arrays of length 4 (using\n * a variant of the algorithm from boost::hash_combine\n *\n * @param in_array1 - First array\n * @param in_array2 - Second array\n * @returns New combined hash\n */\nconst hashCombine4xUint32 = function(\n in_array1: Uint32Array,\n in_array2: Uint32Array,\n io_result?: Uint32Array,\n): Uint32Array {\n let accumulated = io_result;\n if (accumulated === undefined) {\n accumulated = new Uint32Array(in_array2);\n } else {\n accumulated[0] = in_array2[0];\n accumulated[1] = in_array2[1];\n accumulated[2] = in_array2[2];\n accumulated[3] = in_array2[3];\n }\n\n accumulated[0] += 0x9e3779b9;\n accumulated[1] += 0x638f227;\n accumulated[2] += 0x1aff2bad;\n accumulated[3] += 0x3a8f05c5;\n\n accumulated[0] += in_array1[3] << 6;\n accumulated[1] += in_array1[0] << 6;\n accumulated[2] += in_array1[1] << 6;\n accumulated[3] += in_array1[2] << 6;\n\n accumulated[0] += in_array1[2] >> 2;\n accumulated[1] += in_array1[3] >> 2;\n accumulated[2] += in_array1[0] >> 2;\n accumulated[3] += in_array1[1] >> 2;\n\n accumulated[0] = ((accumulated[0] ^ in_array1[1]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[1] = ((accumulated[1] ^ in_array1[2]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[2] = ((accumulated[2] ^ in_array1[3]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[3] = ((accumulated[3] ^ in_array1[0]) * UINT_32HASH_PRIME) >>> 0;\n\n return accumulated;\n};\n\n/**\n * Takes two guids and generates a new derived guid.\n * Note: You should only use this helper function when you need only one combination.\n * Otherwise, it is more efficient to work on the uint8 arrays directly.\n *\n * @param in_guid1 - Input guid\n * @param in_guid2 - Input guid\n * @param base64 - Use base64 encoding instead of standart guids\n * @returns Combined guid\n */\nconst combineGuids = function(in_guid1: string, in_guid2: string, base64 = false): string {\n const firstArray = guidToUint32x4(in_guid1);\n const secondArray = guidToUint32x4(in_guid2);\n const combined = hashCombine4xUint32(firstArray, secondArray);\n return uint32x4ToGUID(combined, base64);\n};\n\n// Make sure the RNG is initialized\nguidRNG.initialize();\n\nconst initializeGUIDGenerator = (...args) => { guidRNG.initialize(...args); };\n\nexport const GuidUtils = {\n uint32x4ToGUID,\n guidToUint32x4,\n base64Tobase16,\n base16ToBase64,\n initializeGUIDGenerator,\n generateGUID,\n isGUID,\n combineGuids,\n hashCombine4xUint32,\n};\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluid-experimental/property-common";
8
- export declare const pkgVersion = "1.2.2";
8
+ export declare const pkgVersion = "2.0.0-internal.1.0.0.81589";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,wCAAwC,CAAC;AAC7D,eAAO,MAAM,UAAU,UAAU,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,wCAAwC,CAAC;AAC7D,eAAO,MAAM,UAAU,+BAA+B,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluid-experimental/property-common";
11
- exports.pkgVersion = "1.2.2";
11
+ exports.pkgVersion = "2.0.0-internal.1.0.0.81589";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,qCAAqC,CAAC;AAChD,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/property-common\";\nexport const pkgVersion = \"1.2.2\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,qCAAqC,CAAC;AAChD,QAAA,UAAU,GAAG,4BAA4B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/property-common\";\nexport const pkgVersion = \"2.0.0-internal.1.0.0.81589\";\n"]}
@@ -8,8 +8,8 @@
8
8
  export declare class ConsoleUtils {
9
9
  /**
10
10
  * Throws an error if the in_condition is false
11
- * @param in_condition - the condition we are testing: a boolean expression.
12
- * @param in_message - the error message that will be thrown if the condition is false.
11
+ * @param in_condition - The condition we are testing: a boolean expression.
12
+ * @param in_message - The error message that will be thrown if the condition is false.
13
13
  */
14
14
  static assert(condition: any, message: string | number): asserts condition;
15
15
  }