@fluid-experimental/property-common 0.56.7 → 0.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +3 -0
- package/dist/datastructures/dataArray.js.map +1 -1
- package/dist/error_objects/flaggedError.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/datastructures/dataArray.js.map +1 -1
- package/lib/error_objects/flaggedError.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +3 -3
- package/platform-dependent/package.json +1 -1
- package/src/datastructures/dataArray.ts +1 -1
- package/src/error_objects/flaggedError.ts +3 -3
- package/src/packageVersion.ts +1 -1
package/.eslintrc.js
CHANGED
|
@@ -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,MAA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KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAE,KAAiB,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 @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;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;Y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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 +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,
|
|
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,EAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3D,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"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -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 = "0.
|
|
8
|
+
export declare const pkgVersion = "0.57.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -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 = "0.
|
|
11
|
+
exports.pkgVersion = "0.57.1";
|
|
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,QAAQ,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 = \"0.
|
|
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,QAAQ,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 = \"0.57.1\";\n"]}
|
|
@@ -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,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C,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;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","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;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;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.\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 +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,MAAM,OAAO,YAAY;IAAzB;QAec,UAAK,GAAW,CAAC,CAAC;IAehC,CAAC;IAbG;;OAEG;IACH,OAAO;QACH,
|
|
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,MAAM,OAAO,YAAY;IAAzB;QAec,UAAK,GAAW,CAAC,CAAC;IAehC,CAAC;IAbG;;OAEG;IACH,OAAO;QACH,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,WAAW;QACP,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;;AA5BD;;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"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -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 = "0.
|
|
8
|
+
export declare const pkgVersion = "0.57.1";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qCAAqC,CAAC;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,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 = \"0.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qCAAqC,CAAC;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,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 = \"0.57.1\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/property-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.1",
|
|
4
4
|
"description": "common functions used in properties",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": "https://github.com/microsoft/FluidFramework",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@fluidframework/build-common": "^0.23.0",
|
|
68
|
-
"@fluidframework/eslint-config-fluid": "^0.
|
|
69
|
-
"@fluidframework/mocha-test-setup": "^0.
|
|
68
|
+
"@fluidframework/eslint-config-fluid": "^0.26.0",
|
|
69
|
+
"@fluidframework/mocha-test-setup": "^0.57.1",
|
|
70
70
|
"@microsoft/api-extractor": "^7.16.1",
|
|
71
71
|
"@rushstack/eslint-config": "^2.5.1",
|
|
72
72
|
"@types/debug": "^4.1.5",
|
|
@@ -326,7 +326,7 @@ class Float64DataArray extends BaseDataArray {
|
|
|
326
326
|
* @param size - The initial size with which to allocate the array.
|
|
327
327
|
*/
|
|
328
328
|
class UniversalDataArray extends BaseDataArray {
|
|
329
|
-
constructor(bufferConstructor: any, size: number)
|
|
329
|
+
constructor(bufferConstructor: any, size: number);
|
|
330
330
|
constructor(size: number);
|
|
331
331
|
constructor(a?, b?) {
|
|
332
332
|
if (b === undefined) {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @param flag - A flag to be checked
|
|
10
10
|
* @returns True if the flag is set in passed flags, false otherwise.
|
|
11
11
|
*/
|
|
12
|
-
const _isFlagSet = (flags: number, flag: number) =>
|
|
12
|
+
const _isFlagSet = (flags: number, flag: number) => {
|
|
13
13
|
// eslint-disable-next-line no-bitwise
|
|
14
14
|
return (flags & flag) === flag;
|
|
15
15
|
};
|
|
@@ -35,13 +35,13 @@ export class FlaggedError {
|
|
|
35
35
|
* @returns True if the quiet flag is set.
|
|
36
36
|
*/
|
|
37
37
|
isQuiet(): boolean {
|
|
38
|
-
return
|
|
38
|
+
return _isFlagSet(this.flags,FlaggedError.FLAGS.QUIET);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @returns True if the transient flag is set.
|
|
43
43
|
*/
|
|
44
44
|
isTransient(): boolean {
|
|
45
|
-
return
|
|
45
|
+
return _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);
|
|
46
46
|
}
|
|
47
47
|
}
|
package/src/packageVersion.ts
CHANGED