@fluid-experimental/property-common 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.203917

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 (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/api-extractor.json +1 -1
  3. package/dist/chronometer.d.ts.map +1 -1
  4. package/dist/chronometer.js +1 -3
  5. package/dist/chronometer.js.map +1 -1
  6. package/dist/datastructures/collection.d.ts.map +1 -1
  7. package/dist/datastructures/collection.js.map +1 -1
  8. package/dist/datastructures/dataArray.d.ts +1 -1
  9. package/dist/datastructures/dataArray.js +1 -1
  10. package/dist/datastructures/dataArray.js.map +1 -1
  11. package/dist/datastructures/integer64.d.ts.map +1 -1
  12. package/dist/datastructures/integer64.js +1 -1
  13. package/dist/datastructures/integer64.js.map +1 -1
  14. package/dist/error_objects/flaggedError.js.map +1 -1
  15. package/dist/error_objects/httpError.d.ts.map +1 -1
  16. package/dist/error_objects/httpError.js +3 -1
  17. package/dist/error_objects/httpError.js.map +1 -1
  18. package/dist/guidUtils.d.ts +1 -1
  19. package/dist/guidUtils.d.ts.map +1 -1
  20. package/lib/chronometer.d.ts.map +1 -1
  21. package/lib/chronometer.js +1 -3
  22. package/lib/chronometer.js.map +1 -1
  23. package/lib/datastructures/collection.d.ts.map +1 -1
  24. package/lib/datastructures/collection.js.map +1 -1
  25. package/lib/datastructures/dataArray.d.ts +1 -1
  26. package/lib/datastructures/dataArray.js +1 -1
  27. package/lib/datastructures/dataArray.js.map +1 -1
  28. package/lib/datastructures/integer64.d.ts.map +1 -1
  29. package/lib/datastructures/integer64.js +1 -1
  30. package/lib/datastructures/integer64.js.map +1 -1
  31. package/lib/error_objects/flaggedError.js.map +1 -1
  32. package/lib/error_objects/httpError.d.ts.map +1 -1
  33. package/lib/error_objects/httpError.js +3 -1
  34. package/lib/error_objects/httpError.js.map +1 -1
  35. package/lib/guidUtils.d.ts +1 -1
  36. package/lib/guidUtils.d.ts.map +1 -1
  37. package/package.json +9 -10
  38. package/platform-dependent/CHANGELOG.md +12 -0
  39. package/platform-dependent/package.json +1 -1
  40. package/src/chronometer.ts +1 -5
  41. package/src/datastructures/collection.ts +4 -1
  42. package/src/datastructures/dataArray.ts +1 -1
  43. package/src/datastructures/integer64.ts +5 -2
  44. package/src/error_objects/httpError.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @fluid-experimental/property-common
2
2
 
3
+ ## 2.0.0-internal.7.1.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.0.0-internal.7.0.0
8
+
9
+ ### Major Changes
10
+
11
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
12
+
13
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
14
+
15
+ ## 2.0.0-internal.6.4.0
16
+
17
+ Dependency updates only.
18
+
3
19
  ## 2.0.0-internal.6.3.0
4
20
 
5
21
  Dependency updates only.
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common.json"
3
+ "extends": "@fluidframework/build-common/api-extractor-base.json"
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"chronometer.d.ts","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqIH;;GAEG;AACH,qBAAa,WAAW;;IAKvB;;OAEG;IACH,KAAK;IAIL;;;;;;;;OAQG;IACH,IAAI,IAAI,WAAW;IAKnB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;;;;;OAQG;WACU,WAAW,CAAC,CAAC,EACzB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,CAAC,CAAA;KAAE,CAAC;CAM9C"}
1
+ {"version":3,"file":"chronometer.d.ts","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiIH;;GAEG;AACH,qBAAa,WAAW;;IAKvB;;OAEG;IACH,KAAK;IAIL;;;;;;;;OAQG;IACH,IAAI,IAAI,WAAW;IAKnB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;;;;;OAQG;WACU,WAAW,CAAC,CAAC,EACzB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,CAAC,CAAA;KAAE,CAAC;CAM9C"}
@@ -112,9 +112,7 @@ let impl;
112
112
  if (typeof process !== "undefined" && typeof process.hrtime !== "undefined") {
113
113
  impl = implementations.node;
114
114
  }
115
- else if (typeof window !== "undefined" &&
116
- typeof window.performance !== "undefined" &&
117
- typeof window.performance.now !== "undefined") {
115
+ else if (typeof window?.performance?.now !== "undefined") {
118
116
  impl = implementations.performance;
119
117
  }
120
118
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"chronometer.js","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;GAEG;AACH,MAAM,eAAe,GAAG;IACvB,kCAAkC;IAClC,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,SAA8B;QACzC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QAEd,MAAM;YACL,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC;QACD,KA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vB,SAA2B;QAE3B,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC3B,CAAC;CACD;AAzED,kCAyEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview A chronometer implementation backed by a high resolution timer.\n * The implementation falls back to milliseconds precision when high resolution timers are not supported.\n */\n\ndeclare let process: any;\n\n/**\n * All the chronometer implementations (hrtime, window.performance, and date:\n */\nconst implementations = {\n\t// Node implementation uses hrtime\n\tnode: {\n\t\tname: \"hrtime\",\n\t\t_startTime: 0,\n\t\t_stopTime: undefined as any[] | undefined,\n\t\tstop: () => {},\n\n\t\t_start() {\n\t\t\tthis._startTime = process.hrtime();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = process.hrtime(this._startTime);\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn (this._stopTime![0] as number) + (this._stopTime![1] as number) / 1000000000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000 + this._stopTime![1] / 1000000;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000000 + this._stopTime![1] / 1000;\n\t\t},\n\t},\n\t// Browser implementation uses window.performance (if available):\n\tperformance: {\n\t\tname: \"window.performance\",\n\t\t_startTime: 0,\n\t\t_stopTime: 0,\n\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = window.performance.now();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = window.performance.now();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this._stopTime - this._startTime;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n\t// Fallback is Date implementation if none of the above is supported:\n\tdate: {\n\t\tname: \"date\",\n\t\t_startTime: new Date(),\n\t\t_stopTime: undefined as Date | undefined,\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = new Date();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = new Date();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn (this._stopTime as Date).getTime() - this._startTime.getTime();\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n};\n\nlet impl:\n\t| typeof implementations.date\n\t| typeof implementations.node\n\t| typeof implementations.performance;\nif (typeof process !== \"undefined\" && typeof process.hrtime !== \"undefined\") {\n\timpl = implementations.node;\n} else if (\n\ttypeof window !== \"undefined\" &&\n\ttypeof window.performance !== \"undefined\" &&\n\ttypeof window.performance.now !== \"undefined\"\n) {\n\timpl = implementations.performance;\n} else {\n\timpl = implementations.date;\n}\n\n/**\n * Creates and starts a new Chronometer.\n */\nexport class Chronometer {\n\tconstructor() {\n\t\tthis.start();\n\t}\n\n\t/**\n\t * Sets the chronometer start time.\n\t */\n\tstart() {\n\t\treturn impl._start.call(this);\n\t}\n\n\t/**\n\t * Stops the chronometer. Stopped chronometers can be reused by calling {@link Chronometer.start} again.\n\t *\n\t * @returns The chronometer instance, so that callers can do this:\n\t *\n\t * ```javascript\n\t * let elapsedMS = chrono.stop().elapsedMS();\n\t * ```\n\t */\n\tstop(): Chronometer {\n\t\timpl._stop.call(this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * @returns How many microseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Implementations that are not precise\n\t * enough may return \"elapsedMilliSec() * 1000\". Measuring elapsed time causes the chronometer\n\t * to be stopped if required (if the chrono is not stopped when this method is called).\n\t */\n\telapsedMicroSec(): number {\n\t\treturn impl._elapsedMicroSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many milliseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedMilliSec(): number {\n\t\treturn impl._elapsedMilliSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many seconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedSec(): number {\n\t\treturn impl._elapsedSec.call(this);\n\t}\n\n\t/**\n\t * A utility function to measure promise execution time.\n\t * @param promiseFn - A function that returns a promise whose execution time is to be measured.\n\t * @returns A Promise that resolves with an object with properties:\n\t *\n\t * - `chrono`: A stopped chronometer instance from which to get the elapsed time,\n\t *\n\t * - `result`: The resolved result of the promise returned by promiseFn\n\t */\n\tstatic async timePromise<T>(\n\t\tpromiseFn: () => Promise<T>,\n\t): Promise<{ chrono: Chronometer; result: T }> {\n\t\tconst chrono = new Chronometer();\n\t\tconst result = await promiseFn();\n\t\tchrono.stop();\n\t\treturn { chrono, result };\n\t}\n}\n"]}
1
+ {"version":3,"file":"chronometer.js","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH;;GAEG;AACH,MAAM,eAAe,GAAG;IACvB,kCAAkC;IAClC,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,SAA8B;QACzC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QAEd,MAAM;YACL,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC;QACD,KAAK;YACJ,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QACD,WAAW;YACV,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBACjC,IAAI,CAAC,IAAI,EAAE,CAAC;aACZ;YACD,oEAAoE;YACpE,OAAQ,IAAI,CAAC,SAAU,CAAC,CAAC,CAAY,GAAI,IAAI,CAAC,SAAU,CAAC,CAAC,CAAY,GAAG,UAAU,CAAC;QACrF,CAAC;QACD,gBAAgB;YACf,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBACjC,IAAI,CAAC,IAAI,EAAE,CAAC;aACZ;YACD,oEAAoE;YACpE,OAAO,IAAI,CAAC,SAAU,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,SAAU,CAAC,CAA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CAAC;IACd,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI;QACH,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACH,eAAe;QACd,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,eAAe;QACd,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,UAAU;QACT,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CACvB,SAA2B;QAE3B,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC3B,CAAC;CACD;AAzED,kCAyEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview A chronometer implementation backed by a high resolution timer.\n * The implementation falls back to milliseconds precision when high resolution timers are not supported.\n */\n\ndeclare let process: any;\n\n/**\n * All the chronometer implementations (hrtime, window.performance, and date:\n */\nconst implementations = {\n\t// Node implementation uses hrtime\n\tnode: {\n\t\tname: \"hrtime\",\n\t\t_startTime: 0,\n\t\t_stopTime: undefined as any[] | undefined,\n\t\tstop: () => {},\n\n\t\t_start() {\n\t\t\tthis._startTime = process.hrtime();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = process.hrtime(this._startTime);\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn (this._stopTime![0] as number) + (this._stopTime![1] as number) / 1000000000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000 + this._stopTime![1] / 1000000;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000000 + this._stopTime![1] / 1000;\n\t\t},\n\t},\n\t// Browser implementation uses window.performance (if available):\n\tperformance: {\n\t\tname: \"window.performance\",\n\t\t_startTime: 0,\n\t\t_stopTime: 0,\n\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = window.performance.now();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = window.performance.now();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this._stopTime - this._startTime;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n\t// Fallback is Date implementation if none of the above is supported:\n\tdate: {\n\t\tname: \"date\",\n\t\t_startTime: new Date(),\n\t\t_stopTime: undefined as Date | undefined,\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = new Date();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = new Date();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn (this._stopTime as Date).getTime() - this._startTime.getTime();\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n};\n\nlet impl:\n\t| typeof implementations.date\n\t| typeof implementations.node\n\t| typeof implementations.performance;\nif (typeof process !== \"undefined\" && typeof process.hrtime !== \"undefined\") {\n\timpl = implementations.node;\n} else if (typeof window?.performance?.now !== \"undefined\") {\n\timpl = implementations.performance;\n} else {\n\timpl = implementations.date;\n}\n\n/**\n * Creates and starts a new Chronometer.\n */\nexport class Chronometer {\n\tconstructor() {\n\t\tthis.start();\n\t}\n\n\t/**\n\t * Sets the chronometer start time.\n\t */\n\tstart() {\n\t\treturn impl._start.call(this);\n\t}\n\n\t/**\n\t * Stops the chronometer. Stopped chronometers can be reused by calling {@link Chronometer.start} again.\n\t *\n\t * @returns The chronometer instance, so that callers can do this:\n\t *\n\t * ```javascript\n\t * let elapsedMS = chrono.stop().elapsedMS();\n\t * ```\n\t */\n\tstop(): Chronometer {\n\t\timpl._stop.call(this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * @returns How many microseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Implementations that are not precise\n\t * enough may return \"elapsedMilliSec() * 1000\". Measuring elapsed time causes the chronometer\n\t * to be stopped if required (if the chrono is not stopped when this method is called).\n\t */\n\telapsedMicroSec(): number {\n\t\treturn impl._elapsedMicroSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many milliseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedMilliSec(): number {\n\t\treturn impl._elapsedMilliSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many seconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedSec(): number {\n\t\treturn impl._elapsedSec.call(this);\n\t}\n\n\t/**\n\t * A utility function to measure promise execution time.\n\t * @param promiseFn - A function that returns a promise whose execution time is to be measured.\n\t * @returns A Promise that resolves with an object with properties:\n\t *\n\t * - `chrono`: A stopped chronometer instance from which to get the elapsed time,\n\t *\n\t * - `result`: The resolved result of the promise returned by promiseFn\n\t */\n\tstatic async timePromise<T>(\n\t\tpromiseFn: () => Promise<T>,\n\t): Promise<{ chrono: Chronometer; result: T }> {\n\t\tconst chrono = new Chronometer();\n\t\tconst result = await promiseFn();\n\t\tchrono.stop();\n\t\treturn { chrono, result };\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":"AAmBA,qBAAa,UAAU,CAAC,CAAC;IAUZ,SAAS,CAAC,KAAK;IAA0B,SAAS,CAAC,KAAK,CAAC,aAAY,GAAG;IATpF,SAAS,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE,CAAM;IAC5C,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,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CAAC;IACJ,CAAC;IAED,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;CACD;AA5ZD,gCA4ZC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n/**\n * @fileoverview Collection class definition\n */\nimport _ from \"lodash\";\n\nconst MSGS = {\n\tTYPE_MISMATCH: \"Type does not match this collection type\",\n\tKEY_ALREADY_EXISTS: \"Collection key already exists. \",\n\tKEY_DOES_NOT_EXIST: \"Collection key does not exist in this collection.\",\n\tMUST_GIVE_KEY: \"Collection missing key.\",\n\tMUST_GIVE_VALUE: \"Collection missing value.\",\n\tKEY_NOT_VALID: \"Key must be of type String or Number\",\n};\n\nexport class Collection<T> {\n\tprotected _items: { [key: string]: T } = {};\n\tprotected _order: (string | number)[] = [];\n\n\t/**\n\t * @param _name - a friendly name to describe this collection. If undefined\n\t * the collection will have a default \"Untitled Collection\" assigned to its name.\n\t * @param _type - optional parameter pointing to the constructor\n\t * of a type this Collection will host.\n\t */\n\tconstructor(protected _name = \"Untitled Collection\", protected _type?: new () => any) {}\n\n\t// Pass-thru binding handles\n\tonAdd(in_key, in_value) {}\n\tonRemove(in_key, in_value) {}\n\tonClear(in_items) {}\n\n\tpublic get items() {\n\t\treturn this._items;\n\t}\n\n\tpublic get keys() {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * @param in_key - Key to store the value under\n\t * @param in_value - Value to store in the collection\n\t * @returns Return the value passed in\n\t */\n\tadd(in_key: number | string, in_value: T): T {\n\t\tthis._checkType(in_value);\n\t\tthis._checkIsNewKey(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\t\tthis._order.push(in_key);\n\n\t\tthis.onAdd(in_key, in_value);\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Checks if in_value's type is equal to this Collection type. If this collection\n\t * has no type set, the check will pass.\n\t *\n\t * @param in_value - A value that is equal to the type managed by this collection.\n\t * @returns Return true if the type is a valid type for this\n\t * collection, throw otherwise.\n\t */\n\tprivate _checkType(in_value: T) {\n\t\tif (this._type && !(in_value instanceof this._type)) {\n\t\t\tthrow new Error(MSGS.TYPE_MISMATCH);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Bulk add items.\n\t * @param in_items - List of key-value pairs to be stored in the collection\n\t * @returns this collection after add\n\t */\n\tbulkAdd(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Bulk remove items.\n\t * @param in_items - List of key-value items to be removed\n\t * @returns this collection after add\n\t */\n\tbulkRemove(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Test if this collection is empty\n\t * @returns true if empty, false otherwise\n\t * */\n\tisEmpty() {\n\t\treturn _.isEmpty(this._items);\n\t}\n\n\t/**\n\t * Return the first item in the collection, null if empty\n\t * @returns first item, or undefined if empty\n\t * */\n\tgetFirstItem(): T | undefined {\n\t\tconst index = _.first(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * Return the last item in the collection, undefined if empty\n\t * @returns The last item, or undefined if empty\n\t * */\n\tgetLastItem(): T | undefined {\n\t\tconst index = _.last(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * @returns Returns the type of collection (Array, etc.)\n\t */\n\tgetType() {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * @returns Returns the name of the collection\n\t */\n\tgetName(): string {\n\t\treturn this._name;\n\t}\n\n\t/**\n\t * Filter out by function\n\t * @param in_filterFunction - with arguments key and item\n\t * @returns A new filtered collection\n\t */\n\tfilter(in_filterFunction: (key: string, item: T) => boolean): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tconst keeper = in_filterFunction(in_key, in_item);\n\t\t\tif (keeper) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterKey\n\t * @param in_filterKey - a single key or an array of keys, if the\n\t * item matches any of the keys it will be filtered in.\n\t * @returns New filtered collection with all the items\n\t * matching at least one key.\n\t */\n\tfilterByKey(in_filterKey: string | string[]): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = _.isArray(in_filterKey)\n\t\t\t? function (in_key, in_item) {\n\t\t\t\t\tif (in_filterKey.includes(in_key)) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: function (in_key, in_item) {\n\t\t\t\t\tif (in_key === in_filterKey) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t };\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterValue\n\t * @param in_filterValue - Value to filter on\n\t * @returns Return a filtered collection\n\t */\n\tfilterByValue(in_filterValue: T): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tif (in_item === in_filterValue) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Remove an item from this Collection. This method returns a Boolean indicating\n\t * the success or failure of the removal. This is practical because if we were\n\t * to throw an error when the key doesn't exist, it would require additional\n\t * checks by the caller to make sure this key exists prior to removal. Which\n\t * would make the attempt of removal more verbose and also costly because the\n\t * caller would have to keep a list – somewhere else – of the things he can\n\t * and cannot remove.\n\t *\n\t * @param in_key - the key we wish to remove\n\t * @returns true if the key exists and was removed, false otherwise.\n\t */\n\tremove(in_key: number | string): boolean {\n\t\tif (!this.has(in_key)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst remember = this._items[in_key];\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete this._items[in_key];\n\t\tthis._order.splice(this._order.indexOf(in_key), 1);\n\n\t\tthis.onRemove(in_key, remember);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Return the number of items in this Collection\n\t * @returns the number of items in the collection\n\t */\n\tgetCount(): number {\n\t\treturn this._order.length;\n\t}\n\n\t/**\n\t * Returns this collection as an ordered Array\n\t * @returns Array including the values\n\t */\n\tgetAsArray() {\n\t\tconst rtnArr: T[] = new Array(this.getCount());\n\n\t\tfor (let i = 0; i < this._order.length; i++) {\n\t\t\trtnArr[i] = this._items[this._order[i]];\n\t\t}\n\n\t\treturn rtnArr;\n\t}\n\n\t/**\n\t * @param in_key - the key we are looking for\n\t * @returns true if the item exists\n\t */\n\thas(in_key: string | number): boolean {\n\t\treturn Object.prototype.hasOwnProperty.call(this._items, in_key);\n\t}\n\n\t/**\n\t * Return an item associated with the given key\n\t * @param in_key - the key for the item in this\n\t * Collection\n\t * @returns The item\n\t */\n\titem(in_key: number | string) {\n\t\treturn this._items[in_key];\n\t}\n\n\t/**\n\t * Checks if this is a new key in the collection. Throw if already exists.\n\t * @param in_key - The key to check against\n\t * @returns true if key is new\n\t */\n\tprivate _checkIsNewKey(in_key: number | string) {\n\t\tif (this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_ALREADY_EXISTS} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if the key exists in the collection. Throw if not.\n\t * @param in_key - the key to check against\n\t * @returns true if key exists\n\t */\n\tprivate _checkKeyExists(in_key: number | string) {\n\t\tif (!this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_DOES_NOT_EXIST} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set an existing key to a value. If key doesn't exist this call will throw\n\t * an error.\n\t * @param in_key - The key we want to modify\n\t * @param in_value - The value we are to set at this key\n\t * @returns The value passed in\n\t */\n\tset(in_key: string, in_value: T) {\n\t\tthis._checkKeyExists(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Iterate over this collection and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - A function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerate(in_callback) {\n\t\tfor (const key of this._order) {\n\t\t\tconst continu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Iterate over this collection starting from the tail and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - a function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerateFromTail(in_callback) {\n\t\tlet key;\n\t\tlet continu;\n\t\tfor (let i = this._order.length - 1; i >= 0; i--) {\n\t\t\tkey = this._order[i];\n\t\t\tcontinu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @returns Return an object containing the items of this collection\n\t */\n\tgetItems(): { [key: string]: T } {\n\t\tconst result = {};\n\n\t\t_.each(this._items, function (item, key) {\n\t\t\tresult[key] = item;\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Return the list of keys\n\t * @returns List of keys\n\t */\n\tgetKeys(): string[] {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * Method used to get the first element in the collection along with its key.\n\t */\n\tpeak() {\n\t\treturn {\n\t\t\titem: this._items[this._order[0]],\n\t\t\tkey: this._order[0],\n\t\t};\n\t}\n\n\t/**\n\t * Clear this collection\n\t * @returns this collection\n\t */\n\tclear() {\n\t\tif (_.isEmpty(this._items)) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.onClear(this._items);\n\n\t\t// Best to just iterate through and remove everything, so that OnRemove\n\t\t// handlers are called.\n\n\t\t_.each(this.getKeys(), (key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t * @returns new Collection\n\t */\n\tclone(): Collection<T> {\n\t\tconst newCol = new Collection<T>(this._name, this._type);\n\t\tnewCol.bulkAdd(this._items);\n\t\treturn newCol;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t */\n\tcopy(in_collection: Collection<T>) {\n\t\tthis.clear();\n\t\tconst its = in_collection.items;\n\n\t\t_.each(its, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t}\n\n\tget values() {\n\t\treturn this.getAsArray();\n\t}\n}\n"]}
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":";;;;;;AAAA;;;GAGG;AACH,4DAA4D;AAC5D;;GAEG;AACH,oDAAuB;AAEvB,MAAM,IAAI,GAAG;IACZ,aAAa,EAAE,0CAA0C;IACzD,kBAAkB,EAAE,iCAAiC;IACrD,kBAAkB,EAAE,mDAAmD;IACvE,aAAa,EAAE,yBAAyB;IACxC,eAAe,EAAE,2BAA2B;IAC5C,aAAa,EAAE,sCAAsC;CACrD,CAAC;AAEF,MAAa,UAAU;IAItB;;;;;OAKG;IACH,YACW,QAAQ,qBAAqB,EAC7B,KAAqB;QADrB,UAAK,GAAL,KAAK,CAAwB;QAC7B,UAAK,GAAL,KAAK,CAAgB;QAXtB,WAAM,GAAyB,EAAE,CAAC;QAClC,WAAM,GAAwB,EAAE,CAAC;IAWxC,CAAC;IAEJ,4BAA4B;IAC5B,KAAK,CAAC,MAAM,EAAE,QA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MAAM;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;CACD;AA/ZD,gCA+ZC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n/**\n * @fileoverview Collection class definition\n */\nimport _ from \"lodash\";\n\nconst MSGS = {\n\tTYPE_MISMATCH: \"Type does not match this collection type\",\n\tKEY_ALREADY_EXISTS: \"Collection key already exists. \",\n\tKEY_DOES_NOT_EXIST: \"Collection key does not exist in this collection.\",\n\tMUST_GIVE_KEY: \"Collection missing key.\",\n\tMUST_GIVE_VALUE: \"Collection missing value.\",\n\tKEY_NOT_VALID: \"Key must be of type String or Number\",\n};\n\nexport class Collection<T> {\n\tprotected _items: { [key: string]: T } = {};\n\tprotected _order: (string | number)[] = [];\n\n\t/**\n\t * @param _name - a friendly name to describe this collection. If undefined\n\t * the collection will have a default \"Untitled Collection\" assigned to its name.\n\t * @param _type - optional parameter pointing to the constructor\n\t * of a type this Collection will host.\n\t */\n\tconstructor(\n\t\tprotected _name = \"Untitled Collection\",\n\t\tprotected _type?: new () => any,\n\t) {}\n\n\t// Pass-thru binding handles\n\tonAdd(in_key, in_value) {}\n\tonRemove(in_key, in_value) {}\n\tonClear(in_items) {}\n\n\tpublic get items() {\n\t\treturn this._items;\n\t}\n\n\tpublic get keys() {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * @param in_key - Key to store the value under\n\t * @param in_value - Value to store in the collection\n\t * @returns Return the value passed in\n\t */\n\tadd(in_key: number | string, in_value: T): T {\n\t\tthis._checkType(in_value);\n\t\tthis._checkIsNewKey(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\t\tthis._order.push(in_key);\n\n\t\tthis.onAdd(in_key, in_value);\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Checks if in_value's type is equal to this Collection type. If this collection\n\t * has no type set, the check will pass.\n\t *\n\t * @param in_value - A value that is equal to the type managed by this collection.\n\t * @returns Return true if the type is a valid type for this\n\t * collection, throw otherwise.\n\t */\n\tprivate _checkType(in_value: T) {\n\t\tif (this._type && !(in_value instanceof this._type)) {\n\t\t\tthrow new Error(MSGS.TYPE_MISMATCH);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Bulk add items.\n\t * @param in_items - List of key-value pairs to be stored in the collection\n\t * @returns this collection after add\n\t */\n\tbulkAdd(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Bulk remove items.\n\t * @param in_items - List of key-value items to be removed\n\t * @returns this collection after add\n\t */\n\tbulkRemove(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Test if this collection is empty\n\t * @returns true if empty, false otherwise\n\t * */\n\tisEmpty() {\n\t\treturn _.isEmpty(this._items);\n\t}\n\n\t/**\n\t * Return the first item in the collection, null if empty\n\t * @returns first item, or undefined if empty\n\t * */\n\tgetFirstItem(): T | undefined {\n\t\tconst index = _.first(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * Return the last item in the collection, undefined if empty\n\t * @returns The last item, or undefined if empty\n\t * */\n\tgetLastItem(): T | undefined {\n\t\tconst index = _.last(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * @returns Returns the type of collection (Array, etc.)\n\t */\n\tgetType() {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * @returns Returns the name of the collection\n\t */\n\tgetName(): string {\n\t\treturn this._name;\n\t}\n\n\t/**\n\t * Filter out by function\n\t * @param in_filterFunction - with arguments key and item\n\t * @returns A new filtered collection\n\t */\n\tfilter(in_filterFunction: (key: string, item: T) => boolean): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tconst keeper = in_filterFunction(in_key, in_item);\n\t\t\tif (keeper) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterKey\n\t * @param in_filterKey - a single key or an array of keys, if the\n\t * item matches any of the keys it will be filtered in.\n\t * @returns New filtered collection with all the items\n\t * matching at least one key.\n\t */\n\tfilterByKey(in_filterKey: string | string[]): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = _.isArray(in_filterKey)\n\t\t\t? function (in_key, in_item) {\n\t\t\t\t\tif (in_filterKey.includes(in_key)) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: function (in_key, in_item) {\n\t\t\t\t\tif (in_key === in_filterKey) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t };\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterValue\n\t * @param in_filterValue - Value to filter on\n\t * @returns Return a filtered collection\n\t */\n\tfilterByValue(in_filterValue: T): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tif (in_item === in_filterValue) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Remove an item from this Collection. This method returns a Boolean indicating\n\t * the success or failure of the removal. This is practical because if we were\n\t * to throw an error when the key doesn't exist, it would require additional\n\t * checks by the caller to make sure this key exists prior to removal. Which\n\t * would make the attempt of removal more verbose and also costly because the\n\t * caller would have to keep a list – somewhere else – of the things he can\n\t * and cannot remove.\n\t *\n\t * @param in_key - the key we wish to remove\n\t * @returns true if the key exists and was removed, false otherwise.\n\t */\n\tremove(in_key: number | string): boolean {\n\t\tif (!this.has(in_key)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst remember = this._items[in_key];\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete this._items[in_key];\n\t\tthis._order.splice(this._order.indexOf(in_key), 1);\n\n\t\tthis.onRemove(in_key, remember);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Return the number of items in this Collection\n\t * @returns the number of items in the collection\n\t */\n\tgetCount(): number {\n\t\treturn this._order.length;\n\t}\n\n\t/**\n\t * Returns this collection as an ordered Array\n\t * @returns Array including the values\n\t */\n\tgetAsArray() {\n\t\tconst rtnArr: T[] = new Array(this.getCount());\n\n\t\tfor (let i = 0; i < this._order.length; i++) {\n\t\t\trtnArr[i] = this._items[this._order[i]];\n\t\t}\n\n\t\treturn rtnArr;\n\t}\n\n\t/**\n\t * @param in_key - the key we are looking for\n\t * @returns true if the item exists\n\t */\n\thas(in_key: string | number): boolean {\n\t\treturn Object.prototype.hasOwnProperty.call(this._items, in_key);\n\t}\n\n\t/**\n\t * Return an item associated with the given key\n\t * @param in_key - the key for the item in this\n\t * Collection\n\t * @returns The item\n\t */\n\titem(in_key: number | string) {\n\t\treturn this._items[in_key];\n\t}\n\n\t/**\n\t * Checks if this is a new key in the collection. Throw if already exists.\n\t * @param in_key - The key to check against\n\t * @returns true if key is new\n\t */\n\tprivate _checkIsNewKey(in_key: number | string) {\n\t\tif (this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_ALREADY_EXISTS} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if the key exists in the collection. Throw if not.\n\t * @param in_key - the key to check against\n\t * @returns true if key exists\n\t */\n\tprivate _checkKeyExists(in_key: number | string) {\n\t\tif (!this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_DOES_NOT_EXIST} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set an existing key to a value. If key doesn't exist this call will throw\n\t * an error.\n\t * @param in_key - The key we want to modify\n\t * @param in_value - The value we are to set at this key\n\t * @returns The value passed in\n\t */\n\tset(in_key: string, in_value: T) {\n\t\tthis._checkKeyExists(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Iterate over this collection and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - A function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerate(in_callback) {\n\t\tfor (const key of this._order) {\n\t\t\tconst continu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Iterate over this collection starting from the tail and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - a function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerateFromTail(in_callback) {\n\t\tlet key;\n\t\tlet continu;\n\t\tfor (let i = this._order.length - 1; i >= 0; i--) {\n\t\t\tkey = this._order[i];\n\t\t\tcontinu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @returns Return an object containing the items of this collection\n\t */\n\tgetItems(): { [key: string]: T } {\n\t\tconst result = {};\n\n\t\t_.each(this._items, function (item, key) {\n\t\t\tresult[key] = item;\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Return the list of keys\n\t * @returns List of keys\n\t */\n\tgetKeys(): string[] {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * Method used to get the first element in the collection along with its key.\n\t */\n\tpeak() {\n\t\treturn {\n\t\t\titem: this._items[this._order[0]],\n\t\t\tkey: this._order[0],\n\t\t};\n\t}\n\n\t/**\n\t * Clear this collection\n\t * @returns this collection\n\t */\n\tclear() {\n\t\tif (_.isEmpty(this._items)) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.onClear(this._items);\n\n\t\t// Best to just iterate through and remove everything, so that OnRemove\n\t\t// handlers are called.\n\n\t\t_.each(this.getKeys(), (key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t * @returns new Collection\n\t */\n\tclone(): Collection<T> {\n\t\tconst newCol = new Collection<T>(this._name, this._type);\n\t\tnewCol.bulkAdd(this._items);\n\t\treturn newCol;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t */\n\tcopy(in_collection: Collection<T>) {\n\t\tthis.clear();\n\t\tconst its = in_collection.items;\n\n\t\t_.each(its, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t}\n\n\tget values() {\n\t\treturn this.getAsArray();\n\t}\n}\n"]}
@@ -21,7 +21,7 @@ declare class BaseDataArray {
21
21
  constructor(bufferConstructor: any, size: number);
22
22
  /**
23
23
  * Get the value at an index. If no index is passed, return zeroth item.
24
- * @param in_idx - The specific item in the data array.
24
+ * @param in_idx - The specific item in the data array.
25
25
  * @returns The value at that index.
26
26
  */
27
27
  getValue(in_idx?: number): any;
@@ -30,7 +30,7 @@ class BaseDataArray {
30
30
  }
31
31
  /**
32
32
  * Get the value at an index. If no index is passed, return zeroth item.
33
- * @param in_idx - The specific item in the data array.
33
+ * @param in_idx - The specific item in the data array.
34
34
  * @returns The value at that index.
35
35
  */
36
36
  getValue(in_idx = 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"dataArray.js","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,wDAAwD;AACxD,4DAA4D;AAE5D;;GAEG;AAEH;;;GAGG;AACH,MAAM,aAAa;IAYlB,YAAY,CAAC,EAAE,CA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IAAI,QAAQ,YAAY,aAAa,EAAE;YAC7C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;SACjE;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACpF;IACF,CAAC;CACD;AAcA,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\tprotected _buffer: any;\n\tprivate readonly bufferConstructor;\n\tprotected size: number;\n\n\tconstructor(size: number);\n\n\t/**\n\t * @param bufferConstructor - This is the constructor to be used to setup the internal buffer of the DataArray.\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(a, b?) {\n\t\tif (typeof a === \"number\") {\n\t\t\tthis.size = a;\n\t\t\tthis.bufferConstructor = this.getBufferCtor();\n\t\t} else {\n\t\t\tthis.bufferConstructor = a;\n\t\t\tthis.size = b;\n\t\t}\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tthis._buffer = new this.bufferConstructor(this.size);\n\t}\n\n\t/**\n\t * Get the value at an index. If no index is passed, return zeroth item.\n\t * @param in_idx - The specific item in the data array.\n\t * @returns The value at that index.\n\t */\n\tgetValue(in_idx = 0): any {\n\t\tif (in_idx >= this.size || in_idx < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer[in_idx];\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer.subarray(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * Return the serialized form of Data Arrays.\n\t * @returns An object containing an array of the values.\n\t */\n\tserialize(): number[] {\n\t\treturn Array.from(this._buffer.subarray(0, this.size));\n\t}\n\n\t/**\n\t * Deserialize data from a serialized representation\n\t * @param in_serialized - the serialized representation\n\t */\n\tdeserialize(in_serialized) {\n\t\tconst values = in_serialized;\n\t\tconst length = in_serialized.length;\n\t\tif (length !== this.size) {\n\t\t\tthis.resize(length);\n\t\t\tthis.size = length;\n\t\t}\n\t\tlet i;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis._buffer[i] = values[i];\n\t\t}\n\t}\n\n\t/**\n\t * Set value at an index.\n\t * @param in_idx - the index\n\t * @param in_value - the value we want to set at index\n\t */\n\tsetValue(in_idx: number, in_value) {\n\t\tif (in_idx < this._buffer.length) {\n\t\t\tthis._buffer[in_idx] = in_value;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray setValue in_idx is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * creates a copy of a typed array with removed elements\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - starting index of range that will be removed\n\t * @param in_deleteCount - number of removed elements\n\t * @returns a copy of the input array without the selected range\n\t */\n\tprivate _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size - in_deleteCount;\n\t\tconst splicedArray = new in_arr.constructor(newSize);\n\t\tsplicedArray.set(in_arr.subarray(0, in_offset));\n\t\tsplicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n\t\treturn splicedArray;\n\t}\n\n\t/**\n\t * remove a range of elements from the array\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n\t\t\tthis.size = this.size - in_deleteCount;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * copy an array with elements inserted into the copy\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - the index where the new elements will be inserted\n\t * @param in_addedArray - the array with the elements that will be added\n\t * @returns the combined array\n\t */\n\tprivate _insert(in_arr, in_offset: number, in_addedArray) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size + (in_addedArray.length as number);\n\t\tconst insertedArray = new in_arr.constructor(newSize);\n\t\tinsertedArray.set(in_arr.subarray(0, in_offset));\n\t\tinsertedArray.set(in_addedArray, in_offset);\n\t\tinsertedArray.set(\n\t\t\tin_arr.subarray(in_offset, this.size),\n\t\t\tin_offset + (in_addedArray.length as number),\n\t\t);\n\t\treturn insertedArray;\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array) {\n\t\tthis._buffer = this._insert(this._buffer, in_offset, in_array);\n\t\tthis.size = this.size + (in_array.length as number);\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis._buffer.set(in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis._buffer.set(in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Insert a value at the end of the array, creates a new element at the end and sets the value.\n\t * @param in_value - The new value.\n\t */\n\tpush(in_value) {\n\t\t// Adjust the buffer if necessary\n\t\tconst bufferLength = this._buffer.length;\n\t\tif (this.size > bufferLength - 1) {\n\t\t\tthis._alloc(this.size * 2 || 1); // grow by a factor of 2x\n\t\t}\n\t\t// set the value and update size\n\t\tthis.setValue(this.size, in_value);\n\t\tthis.size++;\n\t}\n\n\t/**\n\t * Get direct access to the data (for performance reasons) this should be uses read only.\n\t * @returns The (read only) raw data.\n\t */\n\tgetBuffer() {\n\t\treturn this._buffer;\n\t}\n\n\t/**\n\t * Get the constructor of the underlying `TypedArray`.\n\t * @returns The constructor for the data buffer.\n\t */\n\tgetBufferCtor() {\n\t\treturn this.bufferConstructor;\n\t}\n\n\t/**\n\t * Apply a given function to all elements of the array.\n\t * @param in_fn - The function that will be applied to every element.\n\t */\n\titerate(in_fn) {\n\t\tconst l = this.size;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tin_fn(this._buffer[i]);\n\t\t}\n\t}\n\n\t/**\n\t * Tet a resized buffer copy.\n\t * @param in_bufferCtor - The constructor for the returned buffer.\n\t * @param in_buffer - The input buffer (won't be modified).\n\t * @param in_newSize - The target size.\n\t * @returns The buffer with the new size.\n\t */\n\tprivate resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n\t\t// target buffer with the desired new size\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tconst newBuffer = new in_bufferCtor(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tnewBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * Allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later).\n\t * @param size - The target allocated space.\n\t * @returns The DataArray itself.\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Change the size of the array\n\t * @param size - The target size\n\t * @returns The DataArray itself\n\t */\n\tresize(size: number) {\n\t\t// this can be costly!!!\n\t\tthis._alloc(size);\n\t\tthis.size = size;\n\t\treturn this;\n\t}\n\n\tcopy() {\n\t\t// and this!\n\t\tconst newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n\t\tnewBuffer.set(this._buffer);\n\t\treturn newBuffer;\n\t}\n\n\tget length() {\n\t\treturn this.size;\n\t}\n}\n\nclass Int8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int8Array, size);\n\t}\n}\n\nclass Int16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int16Array, size);\n\t}\n}\n\nclass Int32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int32Array, size);\n\t}\n}\n\nclass Uint8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint8Array, size);\n\t}\n}\n\nclass Uint16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint16Array, size);\n\t}\n}\n\nclass Uint32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint32Array, size);\n\t}\n}\n\nclass Float32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float32Array, size);\n\t}\n}\n\nclass Float64DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float64Array, size);\n\t}\n}\n\n/**\n * A data container that can contain every native type\n *\n * @param size - The initial size with which to allocate the array.\n */\nclass UniversalDataArray extends BaseDataArray {\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(size: number);\n\tconstructor(a?, b?) {\n\t\tif (b === undefined) {\n\t\t\tsuper(Array, a);\n\t\t} else {\n\t\t\tsuper(a, b);\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to write array values into another array at a given offset.\n\t *\n\t * @param array - The target array.\n\t * @param values - The values we need to write.\n\t * @param offset - The starting index in target array.\n\t */\n\tprivate arraySet(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = value;\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * Insert the content of an array into the DataArray.\n\t * @param in_offset - The target index.\n\t * @param in_array - The array to be inserted.\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Eemove a range of elements from the array.\n\t * @param in_offset - The start of the range.\n\t * @param in_deleteCount - The number of elements to be removed.\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer.splice(in_offset, in_deleteCount);\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start\n\t * setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySet(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n\t * @param in_buffer - input buffer - not changed\n\t * @param in_newSize - target size\n\t * @returns an Array of the new size\n\t */\n\tprivate resizeBufferArray(in_buffer, in_newSize) {\n\t\t// target buffer with the desired new size\n\t\tconst newBuffer = new Array(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tthis.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later)\n\t * @param size - the target allocated space\n\t * @returns the DataArray itself\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBufferArray(this._buffer, size);\n\t\treturn this;\n\t}\n}\n\n/**\n * A data container that contains a string\n */\nclass StringDataArray extends BaseDataArray {\n\tconstructor() {\n\t\tsuper(String, 0);\n\t\tthis.size = 0;\n\t\tthis._buffer = \"\";\n\t}\n\t/**\n\t * insert the content of a string into the StringDataArray\n\t * @param in_offset - the target index\n\t * @param in_string - the string to be inserted\n\t */\n\tinsertRange(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset,\n\t\t)}`;\n\t\tthis.size = this.size + in_string.length;\n\t}\n\n\t/**\n\t * remove a range of elements from the string\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(\n\t\t\t\tin_offset + in_deleteCount,\n\t\t\t)}`;\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_string values.\n\t * @param in_offset - The offset in this array to begin start setting this arrays values to in_string values.\n\t * @param in_string - The input string.\n\t */\n\tset(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset + in_string.length,\n\t\t)}`;\n\t}\n\n\t/**\n\t * Return a range of characters in the string.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the characters in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number): string {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\tget length() {\n\t\treturn this._buffer.length;\n\t}\n}\n\n/**\n * A data container that can contain boolean type\n */\nclass BoolDataArray extends UniversalDataArray {\n\t/**\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(size: number) {\n\t\tsuper(Array, size);\n\t}\n\n\t/**\n\t * helper function to write and cast to boolean array values into another array at a given offset\n\t * @param array - target array\n\t * @param values - the values we need to write\n\t * @param offset - starting index in target array\n\t */\n\tprivate arraySetBool(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = !!(value as boolean);\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tconst toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(toBeAdded));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySetBool(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n}\n\nexport {\n\tBaseDataArray,\n\tFloat32DataArray,\n\tFloat64DataArray,\n\tInt8DataArray,\n\tInt16DataArray,\n\tInt32DataArray,\n\tUint8DataArray,\n\tUint16DataArray,\n\tUint32DataArray,\n\tUniversalDataArray,\n\tStringDataArray,\n\tBoolDataArray,\n};\n"]}
1
+ {"version":3,"file":"dataArray.js","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,wDAAwD;AACxD,4DAA4D;AAE5D;;GAEG;AAEH;;;GAGG;AACH,MAAM,aAAa;IAYlB,YAAY,CAAC,EAAE,CAAE;QAChB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YAC1B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;YACd,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,aAAa,E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;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACpF;IACF,CAAC;CACD;AAcA,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\tprotected _buffer: any;\n\tprivate readonly bufferConstructor;\n\tprotected size: number;\n\n\tconstructor(size: number);\n\n\t/**\n\t * @param bufferConstructor - This is the constructor to be used to setup the internal buffer of the DataArray.\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(a, b?) {\n\t\tif (typeof a === \"number\") {\n\t\t\tthis.size = a;\n\t\t\tthis.bufferConstructor = this.getBufferCtor();\n\t\t} else {\n\t\t\tthis.bufferConstructor = a;\n\t\t\tthis.size = b;\n\t\t}\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tthis._buffer = new this.bufferConstructor(this.size);\n\t}\n\n\t/**\n\t * Get the value at an index. If no index is passed, return zeroth item.\n\t * @param in_idx - The specific item in the data array.\n\t * @returns The value at that index.\n\t */\n\tgetValue(in_idx = 0): any {\n\t\tif (in_idx >= this.size || in_idx < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer[in_idx];\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer.subarray(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * Return the serialized form of Data Arrays.\n\t * @returns An object containing an array of the values.\n\t */\n\tserialize(): number[] {\n\t\treturn Array.from(this._buffer.subarray(0, this.size));\n\t}\n\n\t/**\n\t * Deserialize data from a serialized representation\n\t * @param in_serialized - the serialized representation\n\t */\n\tdeserialize(in_serialized) {\n\t\tconst values = in_serialized;\n\t\tconst length = in_serialized.length;\n\t\tif (length !== this.size) {\n\t\t\tthis.resize(length);\n\t\t\tthis.size = length;\n\t\t}\n\t\tlet i;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis._buffer[i] = values[i];\n\t\t}\n\t}\n\n\t/**\n\t * Set value at an index.\n\t * @param in_idx - the index\n\t * @param in_value - the value we want to set at index\n\t */\n\tsetValue(in_idx: number, in_value) {\n\t\tif (in_idx < this._buffer.length) {\n\t\t\tthis._buffer[in_idx] = in_value;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray setValue in_idx is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * creates a copy of a typed array with removed elements\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - starting index of range that will be removed\n\t * @param in_deleteCount - number of removed elements\n\t * @returns a copy of the input array without the selected range\n\t */\n\tprivate _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size - in_deleteCount;\n\t\tconst splicedArray = new in_arr.constructor(newSize);\n\t\tsplicedArray.set(in_arr.subarray(0, in_offset));\n\t\tsplicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n\t\treturn splicedArray;\n\t}\n\n\t/**\n\t * remove a range of elements from the array\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n\t\t\tthis.size = this.size - in_deleteCount;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * copy an array with elements inserted into the copy\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - the index where the new elements will be inserted\n\t * @param in_addedArray - the array with the elements that will be added\n\t * @returns the combined array\n\t */\n\tprivate _insert(in_arr, in_offset: number, in_addedArray) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size + (in_addedArray.length as number);\n\t\tconst insertedArray = new in_arr.constructor(newSize);\n\t\tinsertedArray.set(in_arr.subarray(0, in_offset));\n\t\tinsertedArray.set(in_addedArray, in_offset);\n\t\tinsertedArray.set(\n\t\t\tin_arr.subarray(in_offset, this.size),\n\t\t\tin_offset + (in_addedArray.length as number),\n\t\t);\n\t\treturn insertedArray;\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array) {\n\t\tthis._buffer = this._insert(this._buffer, in_offset, in_array);\n\t\tthis.size = this.size + (in_array.length as number);\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis._buffer.set(in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis._buffer.set(in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Insert a value at the end of the array, creates a new element at the end and sets the value.\n\t * @param in_value - The new value.\n\t */\n\tpush(in_value) {\n\t\t// Adjust the buffer if necessary\n\t\tconst bufferLength = this._buffer.length;\n\t\tif (this.size > bufferLength - 1) {\n\t\t\tthis._alloc(this.size * 2 || 1); // grow by a factor of 2x\n\t\t}\n\t\t// set the value and update size\n\t\tthis.setValue(this.size, in_value);\n\t\tthis.size++;\n\t}\n\n\t/**\n\t * Get direct access to the data (for performance reasons) this should be uses read only.\n\t * @returns The (read only) raw data.\n\t */\n\tgetBuffer() {\n\t\treturn this._buffer;\n\t}\n\n\t/**\n\t * Get the constructor of the underlying `TypedArray`.\n\t * @returns The constructor for the data buffer.\n\t */\n\tgetBufferCtor() {\n\t\treturn this.bufferConstructor;\n\t}\n\n\t/**\n\t * Apply a given function to all elements of the array.\n\t * @param in_fn - The function that will be applied to every element.\n\t */\n\titerate(in_fn) {\n\t\tconst l = this.size;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tin_fn(this._buffer[i]);\n\t\t}\n\t}\n\n\t/**\n\t * Tet a resized buffer copy.\n\t * @param in_bufferCtor - The constructor for the returned buffer.\n\t * @param in_buffer - The input buffer (won't be modified).\n\t * @param in_newSize - The target size.\n\t * @returns The buffer with the new size.\n\t */\n\tprivate resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n\t\t// target buffer with the desired new size\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tconst newBuffer = new in_bufferCtor(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tnewBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * Allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later).\n\t * @param size - The target allocated space.\n\t * @returns The DataArray itself.\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Change the size of the array\n\t * @param size - The target size\n\t * @returns The DataArray itself\n\t */\n\tresize(size: number) {\n\t\t// this can be costly!!!\n\t\tthis._alloc(size);\n\t\tthis.size = size;\n\t\treturn this;\n\t}\n\n\tcopy() {\n\t\t// and this!\n\t\tconst newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n\t\tnewBuffer.set(this._buffer);\n\t\treturn newBuffer;\n\t}\n\n\tget length() {\n\t\treturn this.size;\n\t}\n}\n\nclass Int8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int8Array, size);\n\t}\n}\n\nclass Int16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int16Array, size);\n\t}\n}\n\nclass Int32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int32Array, size);\n\t}\n}\n\nclass Uint8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint8Array, size);\n\t}\n}\n\nclass Uint16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint16Array, size);\n\t}\n}\n\nclass Uint32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint32Array, size);\n\t}\n}\n\nclass Float32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float32Array, size);\n\t}\n}\n\nclass Float64DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float64Array, size);\n\t}\n}\n\n/**\n * A data container that can contain every native type\n *\n * @param size - The initial size with which to allocate the array.\n */\nclass UniversalDataArray extends BaseDataArray {\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(size: number);\n\tconstructor(a?, b?) {\n\t\tif (b === undefined) {\n\t\t\tsuper(Array, a);\n\t\t} else {\n\t\t\tsuper(a, b);\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to write array values into another array at a given offset.\n\t *\n\t * @param array - The target array.\n\t * @param values - The values we need to write.\n\t * @param offset - The starting index in target array.\n\t */\n\tprivate arraySet(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = value;\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * Insert the content of an array into the DataArray.\n\t * @param in_offset - The target index.\n\t * @param in_array - The array to be inserted.\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Eemove a range of elements from the array.\n\t * @param in_offset - The start of the range.\n\t * @param in_deleteCount - The number of elements to be removed.\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer.splice(in_offset, in_deleteCount);\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start\n\t * setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySet(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n\t * @param in_buffer - input buffer - not changed\n\t * @param in_newSize - target size\n\t * @returns an Array of the new size\n\t */\n\tprivate resizeBufferArray(in_buffer, in_newSize) {\n\t\t// target buffer with the desired new size\n\t\tconst newBuffer = new Array(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tthis.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later)\n\t * @param size - the target allocated space\n\t * @returns the DataArray itself\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBufferArray(this._buffer, size);\n\t\treturn this;\n\t}\n}\n\n/**\n * A data container that contains a string\n */\nclass StringDataArray extends BaseDataArray {\n\tconstructor() {\n\t\tsuper(String, 0);\n\t\tthis.size = 0;\n\t\tthis._buffer = \"\";\n\t}\n\t/**\n\t * insert the content of a string into the StringDataArray\n\t * @param in_offset - the target index\n\t * @param in_string - the string to be inserted\n\t */\n\tinsertRange(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset,\n\t\t)}`;\n\t\tthis.size = this.size + in_string.length;\n\t}\n\n\t/**\n\t * remove a range of elements from the string\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(\n\t\t\t\tin_offset + in_deleteCount,\n\t\t\t)}`;\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_string values.\n\t * @param in_offset - The offset in this array to begin start setting this arrays values to in_string values.\n\t * @param in_string - The input string.\n\t */\n\tset(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset + in_string.length,\n\t\t)}`;\n\t}\n\n\t/**\n\t * Return a range of characters in the string.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the characters in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number): string {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\tget length() {\n\t\treturn this._buffer.length;\n\t}\n}\n\n/**\n * A data container that can contain boolean type\n */\nclass BoolDataArray extends UniversalDataArray {\n\t/**\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(size: number) {\n\t\tsuper(Array, size);\n\t}\n\n\t/**\n\t * helper function to write and cast to boolean array values into another array at a given offset\n\t * @param array - target array\n\t * @param values - the values we need to write\n\t * @param offset - starting index in target array\n\t */\n\tprivate arraySetBool(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = !!(value as boolean);\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tconst toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(toBeAdded));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySetBool(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n}\n\nexport {\n\tBaseDataArray,\n\tFloat32DataArray,\n\tFloat64DataArray,\n\tInt8DataArray,\n\tInt16DataArray,\n\tInt32DataArray,\n\tUint8DataArray,\n\tUint16DataArray,\n\tUint32DataArray,\n\tUniversalDataArray,\n\tStringDataArray,\n\tBoolDataArray,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;;;;;;;GAUG;AACH,qBAAa,SAAS;IACT,SAAS,CAAC,GAAG;IAAM,SAAS,CAAC,IAAI;gBAAvB,GAAG,SAAI,EAAY,IAAI,SAAI;IAEjD;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;GAEG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,cAAwB,MAAM,2BAG7C;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGnB;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGd"}
1
+ {"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;;;;;;;GAUG;AACH,qBAAa,SAAS;IAEpB,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,IAAI;gBADJ,GAAG,SAAI,EACP,IAAI,SAAI;IAGnB;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;GAEG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,cAAwB,MAAM,2BAG7C;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGnB;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGd"}
@@ -89,7 +89,7 @@ function _stringToInt64(in_signed, in_string, in_radix = 10) {
89
89
  let negative = false;
90
90
  let high = 0;
91
91
  let low = 0;
92
- if (string[0] === "-") {
92
+ if (string.startsWith("-")) {
93
93
  negative = true;
94
94
  position += 1;
95
95
  }
@@ -1 +1 @@
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,CAA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EG;AACH,MAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAiB,EAAE,QAAQ,GAAG,EAAE;QACjD,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC1E,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,KAAK;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD;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 *\n * @remarks This is necessary since js doesn't support 64bit integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions! (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n */\nexport class Integer64 {\n\tconstructor(protected low = 0, protected high = 0) {}\n\n\t/**\n\t * @returns The higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this.high;\n\t}\n\n\t/**\n\t * @returns The lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this.low;\n\t}\n\n\tprotected _int64toString(isSigned: boolean, in_radix = 10): string {\n\t\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n\t\tConsoleUtils.assert(\n\t\t\tin_radix >= 2 && 36 >= in_radix,\n\t\t\t`${MSG.BASE_OUT_OF_RANGE} ${in_radix}`,\n\t\t);\n\n\t\tlet high = this.getValueHigh();\n\t\tlet low = this.getValueLow();\n\t\tlet result = \"\";\n\t\tconst sign = !!(isSigned && high & 0x80000000); // eslint-disable-line no-bitwise\n\t\tif (sign) {\n\t\t\thigh = ~high; // eslint-disable-line no-bitwise\n\t\t\tlow = BIT32 - low;\n\t\t}\n\t\tdo {\n\t\t\tconst mod = (high % in_radix) * BIT32 + low;\n\t\t\thigh = Math.floor(high / in_radix);\n\t\t\tlow = Math.floor(mod / in_radix);\n\t\t\tresult = (mod % in_radix).toString(in_radix) + result;\n\t\t} while (high || low);\n\n\t\treturn sign ? `-${result}` : result;\n\t}\n}\n\n/**\n * stringToInt function parses a string argument updates object's lower and higher 32 bit integer parts.\n *\n * @param in_signed - If the expect response should be signed or unsigned.\n * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.\n * @param in_radix - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above mentioned string.\n *\n * @throws If `in_string` is not a string.\n * @throws If `in_radix` is entered but is not a number between 2 and 36.\n * @throws If the property is a `Uint64` property and `in_string` is a negative number.\n * @throws If `in_string` contains characters other than numbers.\n *\n * @returns Low and high bits of `Int64`.\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\tconst string = in_string.trim();\n\n\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n\tConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n\tlet position = 0;\n\tlet negative = false;\n\tlet high = 0;\n\tlet low = 0;\n\tif (string[0] === \"-\") {\n\t\tnegative = true;\n\t\tposition += 1;\n\t}\n\n\tConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n\twhile (position < string.length) {\n\t\tconst digit = parseInt(string[position++], in_radix);\n\t\tif (isNaN(digit)) {\n\t\t\tthrow new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n\t\t}\n\t\tlow = low * in_radix + digit;\n\t\thigh = high * in_radix + Math.floor(low / BIT32);\n\t\tlow %= BIT32;\n\t}\n\n\tif (negative) {\n\t\t// eslint-disable-next-line no-bitwise\n\t\thigh = ~high;\n\t\tif (low) {\n\t\t\tlow = BIT32 - low;\n\t\t} else {\n\t\t\thigh += 1;\n\t\t}\n\t}\n\n\treturn [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n */\nexport class Int64 extends Integer64 {\n\tstatic fromString = function (in_string: string, radix = 10) {\n\t\tconst [low, high] = _stringToInt64(true, in_string, radix);\n\t\treturn new Int64(low, high);\n\t};\n\n\tclone() {\n\t\treturn new Int64(this.low, this.high);\n\t}\n\n\ttoString(radix = 10) {\n\t\treturn this._int64toString(true, radix);\n\t}\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n */\nexport class Uint64 extends Integer64 {\n\tstatic fromString(in_string: string, in_radix = 10) {\n\t\tconst [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n\t\treturn new Uint64(low, high);\n\t}\n\n\tclone() {\n\t\treturn new Uint64(this.low, this.high);\n\t}\n\n\ttoString(radix) {\n\t\treturn this._int64toString(false, radix);\n\t}\n}\n"]}
1
+ {"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;;;;;;;;;;GAUG;AACH,MAAa,SAAS;IACrB,YACW,MAAM,CAAC,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EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC1E,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,KAAK;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD;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 *\n * @remarks This is necessary since js doesn't support 64bit integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions! (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n */\nexport class Integer64 {\n\tconstructor(\n\t\tprotected low = 0,\n\t\tprotected high = 0,\n\t) {}\n\n\t/**\n\t * @returns The higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this.high;\n\t}\n\n\t/**\n\t * @returns The lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this.low;\n\t}\n\n\tprotected _int64toString(isSigned: boolean, in_radix = 10): string {\n\t\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n\t\tConsoleUtils.assert(\n\t\t\tin_radix >= 2 && 36 >= in_radix,\n\t\t\t`${MSG.BASE_OUT_OF_RANGE} ${in_radix}`,\n\t\t);\n\n\t\tlet high = this.getValueHigh();\n\t\tlet low = this.getValueLow();\n\t\tlet result = \"\";\n\t\tconst sign = !!(isSigned && high & 0x80000000); // eslint-disable-line no-bitwise\n\t\tif (sign) {\n\t\t\thigh = ~high; // eslint-disable-line no-bitwise\n\t\t\tlow = BIT32 - low;\n\t\t}\n\t\tdo {\n\t\t\tconst mod = (high % in_radix) * BIT32 + low;\n\t\t\thigh = Math.floor(high / in_radix);\n\t\t\tlow = Math.floor(mod / in_radix);\n\t\t\tresult = (mod % in_radix).toString(in_radix) + result;\n\t\t} while (high || low);\n\n\t\treturn sign ? `-${result}` : result;\n\t}\n}\n\n/**\n * stringToInt function parses a string argument updates object's lower and higher 32 bit integer parts.\n *\n * @param in_signed - If the expect response should be signed or unsigned.\n * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.\n * @param in_radix - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above mentioned string.\n *\n * @throws If `in_string` is not a string.\n * @throws If `in_radix` is entered but is not a number between 2 and 36.\n * @throws If the property is a `Uint64` property and `in_string` is a negative number.\n * @throws If `in_string` contains characters other than numbers.\n *\n * @returns Low and high bits of `Int64`.\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\tconst string = in_string.trim();\n\n\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n\tConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n\tlet position = 0;\n\tlet negative = false;\n\tlet high = 0;\n\tlet low = 0;\n\tif (string.startsWith(\"-\")) {\n\t\tnegative = true;\n\t\tposition += 1;\n\t}\n\n\tConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n\twhile (position < string.length) {\n\t\tconst digit = parseInt(string[position++], in_radix);\n\t\tif (isNaN(digit)) {\n\t\t\tthrow new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n\t\t}\n\t\tlow = low * in_radix + digit;\n\t\thigh = high * in_radix + Math.floor(low / BIT32);\n\t\tlow %= BIT32;\n\t}\n\n\tif (negative) {\n\t\t// eslint-disable-next-line no-bitwise\n\t\thigh = ~high;\n\t\tif (low) {\n\t\t\tlow = BIT32 - low;\n\t\t} else {\n\t\t\thigh += 1;\n\t\t}\n\t}\n\n\treturn [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n */\nexport class Int64 extends Integer64 {\n\tstatic fromString = function (in_string: string, radix = 10) {\n\t\tconst [low, high] = _stringToInt64(true, in_string, radix);\n\t\treturn new Int64(low, high);\n\t};\n\n\tclone() {\n\t\treturn new Int64(this.low, this.high);\n\t}\n\n\ttoString(radix = 10) {\n\t\treturn this._int64toString(true, radix);\n\t}\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n */\nexport class Uint64 extends Integer64 {\n\tstatic fromString(in_string: string, in_radix = 10) {\n\t\tconst [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n\t\treturn new Uint64(low, high);\n\t}\n\n\tclone() {\n\t\treturn new Uint64(this.low, this.high);\n\t}\n\n\ttoString(radix) {\n\t\treturn this._int64toString(false, radix);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF,MAAa,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IAbA;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA7BF,oCA8BC;AA7BA;;GAEG;AACI,kBAAK,GAAG;IACd;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACR,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 */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
1
+ {"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF,MAAa,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IAbA;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA7BF,oCA8BC;AA7BA;;GAEG;AACI,kBAAK,GAAG;IACd;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACR,AATW,CASV","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Checks if a flag is set\n * @param flags - Flags set within an error object\n * @param flag - A flag to be checked\n * @returns True if the flag is set in passed flags, false otherwise.\n */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;IACN,UAAU,CAAC;IACX,aAAa,CAAC;IACd,MAAM,CAAC;IACP,GAAG,CAAC;IACJ,KAAK;gBALL,KAAK,CAAC,oBAAQ,EACd,UAAU,CAAC,oBAAQ,EACnB,aAAa,CAAC,oBAAQ,EACtB,MAAM,CAAC,oBAAQ,EACf,GAAG,CAAC,oBAAQ,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAWlB"}
1
+ {"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;IACN,UAAU,CAAC;IACX,aAAa,CAAC;IACd,MAAM,CAAC;IACP,GAAG,CAAC;IACJ,KAAK;gBALL,KAAK,CAAC,oBAAQ,EACd,UAAU,CAAC,oBAAQ,EACnB,aAAa,CAAC,oBAAQ,EACtB,MAAM,CAAC,oBAAQ,EACf,GAAG,CAAC,oBAAQ,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAYlB"}
@@ -50,7 +50,9 @@ class HTTPError extends Error {
50
50
  */
51
51
  toString() {
52
52
  const stack = this.stack === undefined ? "" : String(this.stack);
53
- const isFirefox = typeof window !== "undefined" &&
53
+ const isFirefox =
54
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain causes a test failure
55
+ typeof window !== "undefined" &&
54
56
  typeof window.navigator !== "undefined" &&
55
57
  typeof window.navigator.userAgent !== "undefined" &&
56
58
  window.navigator.userAgent.toLowerCase().includes("firefox");
@@ -1 +1 @@
1
- {"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,iDAA8C;AAE9C;;;;;;;;GAQG;AACH,MAAa,SAAU,SAAQ,KAAK;IACnC,YACQ,KAAc,EACd,UAAmB,EACnB,aAAsB,EACtB,MAAe,EACf,GAAY,EACZ,QAAQ,CAAC;QAEhB,KAAK,EAAE,CAAC;QAPD,UAAK,GAAL,KAAK,CAAS;QACd,eAAU,GAAV,UAAU,CAAS;QACnB,kBAAa,GAAb,aAAa,CAAS;QACtB,WAAM,GAAN,MAAM,CAAS;QACf,QAAG,GAAH,GAAG,CAAS;QACZ,UAAK,GAAL,KAAK,CAAI;QAGhB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC;IAID,OAAO;QACN,OAAO,2BAAY,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,WAAW;QACV,OAAO,2BAAY,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEO,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG;QACrE,MAAM,QAAQ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sDC;AAtCO,eAAK,GAAG,2BAAY,CAAC,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { FlaggedError } from \"./flaggedError\";\n\n/**\n * Class extending Error with HTTP-specific error information like statusCode and statusMessage\n * @param title - The error title\n * @param statusCode - A numeric HTTP status code\n * @param statusMessage - A string message representing the response status message\n * @param method - The HTTP method used in the request\n * @param url - The URL that the request was sent to\n * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n */\nexport class HTTPError extends Error {\n\tconstructor(\n\t\tpublic title?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic statusMessage?: string,\n\t\tpublic method?: string,\n\t\tpublic url?: string,\n\t\tpublic flags = 0,\n\t) {\n\t\tsuper();\n\t\tObject.setPrototypeOf(this, HTTPError.prototype);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.message = this._generateMessage(title, statusCode, statusMessage, method, url);\n\t\tthis.stack = new Error(this.message).stack;\n\t}\n\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\tisQuiet(): boolean {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient(): boolean {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\tprivate _generateMessage(title, statusCode, statusMessage, method, url) {\n\t\tconst titleStr = title === undefined ? \"\" : String(title);\n\t\tconst statusCodeStr = statusCode === undefined ? \"\" : String(statusCode);\n\t\tconst statusMessageStr = statusMessage === undefined ? \"\" : String(statusMessage);\n\t\tconst methodStr = method === undefined ? \"\" : String(method);\n\t\tconst urlStr = url === undefined ? \"\" : String(url);\n\n\t\treturn (\n\t\t\t`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +\n\t\t\t`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`\n\t\t);\n\t}\n\n\t/**\n\t * Returns a string representing the HTTPError object\n\t * @returns a string representing the HTTPError object\n\t */\n\ttoString(): string {\n\t\tconst stack = this.stack === undefined ? \"\" : String(this.stack);\n\n\t\tconst isFirefox =\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\ttypeof window.navigator !== \"undefined\" &&\n\t\t\ttypeof window.navigator.userAgent !== \"undefined\" &&\n\t\t\twindow.navigator.userAgent.toLowerCase().includes(\"firefox\");\n\n\t\treturn isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;\n\t}\n}\n"]}
1
+ {"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,iDAA8C;AAE9C;;;;;;;;GAQG;AACH,MAAa,SAAU,SAAQ,KAAK;IACnC,YACQ,KAAc,EACd,UAAmB,EACnB,aAAsB,EACtB,MAAe,EACf,GAAY,EACZ,QAAQ,CAAC;QAEhB,KAAK,EAAE,CAAC;QAPD,UAAK,GAAL,KAAK,CAAS;QACd,eAAU,GAAV,UAAU,CAAS;QACnB,kBAAa,GAAb,aAAa,CAAS;QACtB,WAAM,GAAN,MAAM,CAAS;QACf,QAAG,GAAH,GAAG,CAAS;QACZ,UAAK,GAAL,KAAK,CAAI;QAGhB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC;IAID,OAAO;QACN,OAAO,2BAAY,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,WAAW;QACV,OAAO,2BAAY,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC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,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC;IACzE,CAAC;;AAtDF,8BAuDC;AAvCO,eAAK,GAAG,2BAAY,CAAC,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { FlaggedError } from \"./flaggedError\";\n\n/**\n * Class extending Error with HTTP-specific error information like statusCode and statusMessage\n * @param title - The error title\n * @param statusCode - A numeric HTTP status code\n * @param statusMessage - A string message representing the response status message\n * @param method - The HTTP method used in the request\n * @param url - The URL that the request was sent to\n * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n */\nexport class HTTPError extends Error {\n\tconstructor(\n\t\tpublic title?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic statusMessage?: string,\n\t\tpublic method?: string,\n\t\tpublic url?: string,\n\t\tpublic flags = 0,\n\t) {\n\t\tsuper();\n\t\tObject.setPrototypeOf(this, HTTPError.prototype);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.message = this._generateMessage(title, statusCode, statusMessage, method, url);\n\t\tthis.stack = new Error(this.message).stack;\n\t}\n\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\tisQuiet(): boolean {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient(): boolean {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\tprivate _generateMessage(title, statusCode, statusMessage, method, url) {\n\t\tconst titleStr = title === undefined ? \"\" : String(title);\n\t\tconst statusCodeStr = statusCode === undefined ? \"\" : String(statusCode);\n\t\tconst statusMessageStr = statusMessage === undefined ? \"\" : String(statusMessage);\n\t\tconst methodStr = method === undefined ? \"\" : String(method);\n\t\tconst urlStr = url === undefined ? \"\" : String(url);\n\n\t\treturn (\n\t\t\t`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +\n\t\t\t`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`\n\t\t);\n\t}\n\n\t/**\n\t * Returns a string representing the HTTPError object\n\t * @returns a string representing the HTTPError object\n\t */\n\ttoString(): string {\n\t\tconst stack = this.stack === undefined ? \"\" : String(this.stack);\n\n\t\tconst isFirefox =\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain causes a test failure\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\ttypeof window.navigator !== \"undefined\" &&\n\t\t\ttypeof window.navigator.userAgent !== \"undefined\" &&\n\t\t\twindow.navigator.userAgent.toLowerCase().includes(\"firefox\");\n\n\t\treturn isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;\n\t}\n}\n"]}
@@ -11,6 +11,6 @@ export declare const GuidUtils: {
11
11
  generateGUID: (base64?: boolean) => string;
12
12
  isGUID: (in_guid: string) => boolean;
13
13
  combineGuids: (in_guid1: string, in_guid2: string, base64?: boolean) => string;
14
- hashCombine4xUint32: (in_array1: Uint32Array, in_array2: Uint32Array, io_result?: Uint32Array | undefined) => Uint32Array;
14
+ hashCombine4xUint32: (in_array1: Uint32Array, in_array2: Uint32Array, io_result?: Uint32Array) => Uint32Array;
15
15
  };
16
16
  //# sourceMappingURL=guidUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqUH,eAAO,MAAM,SAAS;mCAhLP,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,WACzC,OAAO,KACb,MAAM;8BA+BC,MAAM,WACP,WAAW,KACjB,WAAW;8BAsBmB,MAAM;8BASN,MAAM;;wCAaS,MAAM;sBAwB7B,MAAM;6BA2DU,MAAM,YAAY,MAAM,uBAAmB,MAAM;qCAhD9E,WAAW,aACX,WAAW,0CAEpB,WAAW;CAqEb,CAAC"}
1
+ {"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqUH,eAAO,MAAM,SAAS;mCAhLP,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,WACzC,OAAO,KACb,MAAM;8BA+BC,MAAM,WACP,WAAW,KACjB,WAAW;8BAsBmB,MAAM;8BASN,MAAM;;wCAaS,MAAM;sBAwB7B,MAAM;6BA2DU,MAAM,YAAY,MAAM,uBAAmB,MAAM;qCAhD9E,WAAW,aACX,WAAW,cACV,WAAW,KACrB,WAAW;CAqEb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"chronometer.d.ts","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqIH;;GAEG;AACH,qBAAa,WAAW;;IAKvB;;OAEG;IACH,KAAK;IAIL;;;;;;;;OAQG;IACH,IAAI,IAAI,WAAW;IAKnB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;;;;;OAQG;WACU,WAAW,CAAC,CAAC,EACzB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,CAAC,CAAA;KAAE,CAAC;CAM9C"}
1
+ {"version":3,"file":"chronometer.d.ts","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiIH;;GAEG;AACH,qBAAa,WAAW;;IAKvB;;OAEG;IACH,KAAK;IAIL;;;;;;;;OAQG;IACH,IAAI,IAAI,WAAW;IAKnB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;;;;;OAQG;WACU,WAAW,CAAC,CAAC,EACzB,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,CAAC,CAAA;KAAE,CAAC;CAM9C"}
@@ -109,9 +109,7 @@ let impl;
109
109
  if (typeof process !== "undefined" && typeof process.hrtime !== "undefined") {
110
110
  impl = implementations.node;
111
111
  }
112
- else if (typeof window !== "undefined" &&
113
- typeof window.performance !== "undefined" &&
114
- typeof window.performance.now !== "undefined") {
112
+ else if (typeof window?.performance?.now !== "undefined") {
115
113
  impl = implementations.performance;
116
114
  }
117
115
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"chronometer.js","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;GAEG;AACH,MAAM,eAAe,GAAG;IACvB,kCAAkC;IAClC,IAAI,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,SAA8B;QACzC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QAEd,MAAM;YACL,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC;QACD,KAAK;YACJ,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QACD,WAAW;YACV,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBACjC,IAAI,CAAC,IAAI,EAAE,CAAC;aACZ;YACD,oEAAoE;YACpE,OAAQ,IAAI,CAAC,SAAU,CAAC,CAAC,CAAY,GAAI,IAAI,CAAC,SAAU,CAAC,CAAC,CAAY,GAAG,UAAU,CAAC;QACrF,CAAC;QACD,gBAAgB;YACf,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBACjC,IAAI,CAAC,IAAI,EAAE,CAAC;aACZ;YACD,oEAAoE;YACpE,OAAO,IAAI,CAAC,SAAU,CAAC,CA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C;CACnC;KAAM;IACN,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,OAAO,WAAW;IACvB;QACC,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI;QACH,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACH,eAAe;QACd,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,eAAe;QACd,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,UAAU;QACT,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CACvB,SAA2B;QAE3B,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC3B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview A chronometer implementation backed by a high resolution timer.\n * The implementation falls back to milliseconds precision when high resolution timers are not supported.\n */\n\ndeclare let process: any;\n\n/**\n * All the chronometer implementations (hrtime, window.performance, and date:\n */\nconst implementations = {\n\t// Node implementation uses hrtime\n\tnode: {\n\t\tname: \"hrtime\",\n\t\t_startTime: 0,\n\t\t_stopTime: undefined as any[] | undefined,\n\t\tstop: () => {},\n\n\t\t_start() {\n\t\t\tthis._startTime = process.hrtime();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = process.hrtime(this._startTime);\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn (this._stopTime![0] as number) + (this._stopTime![1] as number) / 1000000000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000 + this._stopTime![1] / 1000000;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000000 + this._stopTime![1] / 1000;\n\t\t},\n\t},\n\t// Browser implementation uses window.performance (if available):\n\tperformance: {\n\t\tname: \"window.performance\",\n\t\t_startTime: 0,\n\t\t_stopTime: 0,\n\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = window.performance.now();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = window.performance.now();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this._stopTime - this._startTime;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n\t// Fallback is Date implementation if none of the above is supported:\n\tdate: {\n\t\tname: \"date\",\n\t\t_startTime: new Date(),\n\t\t_stopTime: undefined as Date | undefined,\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = new Date();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = new Date();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn (this._stopTime as Date).getTime() - this._startTime.getTime();\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n};\n\nlet impl:\n\t| typeof implementations.date\n\t| typeof implementations.node\n\t| typeof implementations.performance;\nif (typeof process !== \"undefined\" && typeof process.hrtime !== \"undefined\") {\n\timpl = implementations.node;\n} else if (\n\ttypeof window !== \"undefined\" &&\n\ttypeof window.performance !== \"undefined\" &&\n\ttypeof window.performance.now !== \"undefined\"\n) {\n\timpl = implementations.performance;\n} else {\n\timpl = implementations.date;\n}\n\n/**\n * Creates and starts a new Chronometer.\n */\nexport class Chronometer {\n\tconstructor() {\n\t\tthis.start();\n\t}\n\n\t/**\n\t * Sets the chronometer start time.\n\t */\n\tstart() {\n\t\treturn impl._start.call(this);\n\t}\n\n\t/**\n\t * Stops the chronometer. Stopped chronometers can be reused by calling {@link Chronometer.start} again.\n\t *\n\t * @returns The chronometer instance, so that callers can do this:\n\t *\n\t * ```javascript\n\t * let elapsedMS = chrono.stop().elapsedMS();\n\t * ```\n\t */\n\tstop(): Chronometer {\n\t\timpl._stop.call(this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * @returns How many microseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Implementations that are not precise\n\t * enough may return \"elapsedMilliSec() * 1000\". Measuring elapsed time causes the chronometer\n\t * to be stopped if required (if the chrono is not stopped when this method is called).\n\t */\n\telapsedMicroSec(): number {\n\t\treturn impl._elapsedMicroSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many milliseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedMilliSec(): number {\n\t\treturn impl._elapsedMilliSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many seconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedSec(): number {\n\t\treturn impl._elapsedSec.call(this);\n\t}\n\n\t/**\n\t * A utility function to measure promise execution time.\n\t * @param promiseFn - A function that returns a promise whose execution time is to be measured.\n\t * @returns A Promise that resolves with an object with properties:\n\t *\n\t * - `chrono`: A stopped chronometer instance from which to get the elapsed time,\n\t *\n\t * - `result`: The resolved result of the promise returned by promiseFn\n\t */\n\tstatic async timePromise<T>(\n\t\tpromiseFn: () => Promise<T>,\n\t): Promise<{ chrono: Chronometer; result: T }> {\n\t\tconst chrono = new Chronometer();\n\t\tconst result = await promiseFn();\n\t\tchrono.stop();\n\t\treturn { chrono, result };\n\t}\n}\n"]}
1
+ {"version":3,"file":"chronometer.js","sourceRoot":"","sources":["../src/chronometer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;GAEG;AACH,MAAM,eAAe,GAAG;IACvB,kCAAkC;IAClC,IAAI,EAAE;QACL,IAAI,EAAE,QA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I,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CACvB,SAA2B;QAE3B,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC3B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview A chronometer implementation backed by a high resolution timer.\n * The implementation falls back to milliseconds precision when high resolution timers are not supported.\n */\n\ndeclare let process: any;\n\n/**\n * All the chronometer implementations (hrtime, window.performance, and date:\n */\nconst implementations = {\n\t// Node implementation uses hrtime\n\tnode: {\n\t\tname: \"hrtime\",\n\t\t_startTime: 0,\n\t\t_stopTime: undefined as any[] | undefined,\n\t\tstop: () => {},\n\n\t\t_start() {\n\t\t\tthis._startTime = process.hrtime();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = process.hrtime(this._startTime);\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn (this._stopTime![0] as number) + (this._stopTime![1] as number) / 1000000000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000 + this._stopTime![1] / 1000000;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (this._stopTime === undefined) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this._stopTime![0] * 1000000 + this._stopTime![1] / 1000;\n\t\t},\n\t},\n\t// Browser implementation uses window.performance (if available):\n\tperformance: {\n\t\tname: \"window.performance\",\n\t\t_startTime: 0,\n\t\t_stopTime: 0,\n\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = window.performance.now();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = window.performance.now();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this._stopTime - this._startTime;\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n\t// Fallback is Date implementation if none of the above is supported:\n\tdate: {\n\t\tname: \"date\",\n\t\t_startTime: new Date(),\n\t\t_stopTime: undefined as Date | undefined,\n\t\tstop: () => {},\n\t\telapsedMilliSec: () => 0,\n\n\t\t_start() {\n\t\t\tthis._startTime = new Date();\n\t\t},\n\t\t_stop() {\n\t\t\tthis._stopTime = new Date();\n\t\t},\n\t\t_elapsedSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() / 1000;\n\t\t},\n\t\t_elapsedMilliSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn (this._stopTime as Date).getTime() - this._startTime.getTime();\n\t\t},\n\t\t_elapsedMicroSec(): number {\n\t\t\tif (!this._stopTime) {\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\treturn this.elapsedMilliSec() * 1000;\n\t\t},\n\t},\n};\n\nlet impl:\n\t| typeof implementations.date\n\t| typeof implementations.node\n\t| typeof implementations.performance;\nif (typeof process !== \"undefined\" && typeof process.hrtime !== \"undefined\") {\n\timpl = implementations.node;\n} else if (typeof window?.performance?.now !== \"undefined\") {\n\timpl = implementations.performance;\n} else {\n\timpl = implementations.date;\n}\n\n/**\n * Creates and starts a new Chronometer.\n */\nexport class Chronometer {\n\tconstructor() {\n\t\tthis.start();\n\t}\n\n\t/**\n\t * Sets the chronometer start time.\n\t */\n\tstart() {\n\t\treturn impl._start.call(this);\n\t}\n\n\t/**\n\t * Stops the chronometer. Stopped chronometers can be reused by calling {@link Chronometer.start} again.\n\t *\n\t * @returns The chronometer instance, so that callers can do this:\n\t *\n\t * ```javascript\n\t * let elapsedMS = chrono.stop().elapsedMS();\n\t * ```\n\t */\n\tstop(): Chronometer {\n\t\timpl._stop.call(this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * @returns How many microseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Implementations that are not precise\n\t * enough may return \"elapsedMilliSec() * 1000\". Measuring elapsed time causes the chronometer\n\t * to be stopped if required (if the chrono is not stopped when this method is called).\n\t */\n\telapsedMicroSec(): number {\n\t\treturn impl._elapsedMicroSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many milliseconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedMilliSec(): number {\n\t\treturn impl._elapsedMilliSec.call(this);\n\t}\n\n\t/**\n\t * @returns How many seconds have elapsed between the last call to {@link Chronometer.start}\n\t * (or the chronometer creation), and {@link Chronometer.stop}. Measuring elapsed time causes the\n\t * chronometer to be stopped if required (if the chrono is not stopped when this method is\n\t * called).\n\t */\n\telapsedSec(): number {\n\t\treturn impl._elapsedSec.call(this);\n\t}\n\n\t/**\n\t * A utility function to measure promise execution time.\n\t * @param promiseFn - A function that returns a promise whose execution time is to be measured.\n\t * @returns A Promise that resolves with an object with properties:\n\t *\n\t * - `chrono`: A stopped chronometer instance from which to get the elapsed time,\n\t *\n\t * - `result`: The resolved result of the promise returned by promiseFn\n\t */\n\tstatic async timePromise<T>(\n\t\tpromiseFn: () => Promise<T>,\n\t): Promise<{ chrono: Chronometer; result: T }> {\n\t\tconst chrono = new Chronometer();\n\t\tconst result = await promiseFn();\n\t\tchrono.stop();\n\t\treturn { chrono, result };\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":"AAmBA,qBAAa,UAAU,CAAC,CAAC;IAUZ,SAAS,CAAC,KAAK;IAA0B,SAAS,CAAC,KAAK,CAAC,aAAY,GAAG;IATpF,SAAS,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE,CAAM;IAC5C,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAM;IAE3C;;;;;OAKG;gBACmB,KAAK,SAAwB,EAAY,KAAK,CAAC,aAAY,GAAG,aAAA;IAGpF,KAAK,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA;IACtB,QAAQ,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA;IACzB,OAAO,CAAC,QAAQ,KAAA;IAEhB,IAAW,KAAK;;MAEf;IAED,IAAW,IAAI,aAEd;IAED;;;;OAIG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAY5C;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE;IAOt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AAC,CAAC;QAE1B,uEAAuE;QACvE,uBAAuB;QAEvB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;YAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACH,KAAK;QACJ,MAAM,MAAM,GAAG,IAAI,UAAU,CAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,aAA4B;QAChC,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC;QAEhC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YACzB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n/**\n * @fileoverview Collection class definition\n */\nimport _ from \"lodash\";\n\nconst MSGS = {\n\tTYPE_MISMATCH: \"Type does not match this collection type\",\n\tKEY_ALREADY_EXISTS: \"Collection key already exists. \",\n\tKEY_DOES_NOT_EXIST: \"Collection key does not exist in this collection.\",\n\tMUST_GIVE_KEY: \"Collection missing key.\",\n\tMUST_GIVE_VALUE: \"Collection missing value.\",\n\tKEY_NOT_VALID: \"Key must be of type String or Number\",\n};\n\nexport class Collection<T> {\n\tprotected _items: { [key: string]: T } = {};\n\tprotected _order: (string | number)[] = [];\n\n\t/**\n\t * @param _name - a friendly name to describe this collection. If undefined\n\t * the collection will have a default \"Untitled Collection\" assigned to its name.\n\t * @param _type - optional parameter pointing to the constructor\n\t * of a type this Collection will host.\n\t */\n\tconstructor(protected _name = \"Untitled Collection\", protected _type?: new () => any) {}\n\n\t// Pass-thru binding handles\n\tonAdd(in_key, in_value) {}\n\tonRemove(in_key, in_value) {}\n\tonClear(in_items) {}\n\n\tpublic get items() {\n\t\treturn this._items;\n\t}\n\n\tpublic get keys() {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * @param in_key - Key to store the value under\n\t * @param in_value - Value to store in the collection\n\t * @returns Return the value passed in\n\t */\n\tadd(in_key: number | string, in_value: T): T {\n\t\tthis._checkType(in_value);\n\t\tthis._checkIsNewKey(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\t\tthis._order.push(in_key);\n\n\t\tthis.onAdd(in_key, in_value);\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Checks if in_value's type is equal to this Collection type. If this collection\n\t * has no type set, the check will pass.\n\t *\n\t * @param in_value - A value that is equal to the type managed by this collection.\n\t * @returns Return true if the type is a valid type for this\n\t * collection, throw otherwise.\n\t */\n\tprivate _checkType(in_value: T) {\n\t\tif (this._type && !(in_value instanceof this._type)) {\n\t\t\tthrow new Error(MSGS.TYPE_MISMATCH);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Bulk add items.\n\t * @param in_items - List of key-value pairs to be stored in the collection\n\t * @returns this collection after add\n\t */\n\tbulkAdd(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Bulk remove items.\n\t * @param in_items - List of key-value items to be removed\n\t * @returns this collection after add\n\t */\n\tbulkRemove(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Test if this collection is empty\n\t * @returns true if empty, false otherwise\n\t * */\n\tisEmpty() {\n\t\treturn _.isEmpty(this._items);\n\t}\n\n\t/**\n\t * Return the first item in the collection, null if empty\n\t * @returns first item, or undefined if empty\n\t * */\n\tgetFirstItem(): T | undefined {\n\t\tconst index = _.first(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * Return the last item in the collection, undefined if empty\n\t * @returns The last item, or undefined if empty\n\t * */\n\tgetLastItem(): T | undefined {\n\t\tconst index = _.last(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * @returns Returns the type of collection (Array, etc.)\n\t */\n\tgetType() {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * @returns Returns the name of the collection\n\t */\n\tgetName(): string {\n\t\treturn this._name;\n\t}\n\n\t/**\n\t * Filter out by function\n\t * @param in_filterFunction - with arguments key and item\n\t * @returns A new filtered collection\n\t */\n\tfilter(in_filterFunction: (key: string, item: T) => boolean): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tconst keeper = in_filterFunction(in_key, in_item);\n\t\t\tif (keeper) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterKey\n\t * @param in_filterKey - a single key or an array of keys, if the\n\t * item matches any of the keys it will be filtered in.\n\t * @returns New filtered collection with all the items\n\t * matching at least one key.\n\t */\n\tfilterByKey(in_filterKey: string | string[]): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = _.isArray(in_filterKey)\n\t\t\t? function (in_key, in_item) {\n\t\t\t\t\tif (in_filterKey.includes(in_key)) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: function (in_key, in_item) {\n\t\t\t\t\tif (in_key === in_filterKey) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t };\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterValue\n\t * @param in_filterValue - Value to filter on\n\t * @returns Return a filtered collection\n\t */\n\tfilterByValue(in_filterValue: T): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tif (in_item === in_filterValue) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Remove an item from this Collection. This method returns a Boolean indicating\n\t * the success or failure of the removal. This is practical because if we were\n\t * to throw an error when the key doesn't exist, it would require additional\n\t * checks by the caller to make sure this key exists prior to removal. Which\n\t * would make the attempt of removal more verbose and also costly because the\n\t * caller would have to keep a list – somewhere else – of the things he can\n\t * and cannot remove.\n\t *\n\t * @param in_key - the key we wish to remove\n\t * @returns true if the key exists and was removed, false otherwise.\n\t */\n\tremove(in_key: number | string): boolean {\n\t\tif (!this.has(in_key)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst remember = this._items[in_key];\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete this._items[in_key];\n\t\tthis._order.splice(this._order.indexOf(in_key), 1);\n\n\t\tthis.onRemove(in_key, remember);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Return the number of items in this Collection\n\t * @returns the number of items in the collection\n\t */\n\tgetCount(): number {\n\t\treturn this._order.length;\n\t}\n\n\t/**\n\t * Returns this collection as an ordered Array\n\t * @returns Array including the values\n\t */\n\tgetAsArray() {\n\t\tconst rtnArr: T[] = new Array(this.getCount());\n\n\t\tfor (let i = 0; i < this._order.length; i++) {\n\t\t\trtnArr[i] = this._items[this._order[i]];\n\t\t}\n\n\t\treturn rtnArr;\n\t}\n\n\t/**\n\t * @param in_key - the key we are looking for\n\t * @returns true if the item exists\n\t */\n\thas(in_key: string | number): boolean {\n\t\treturn Object.prototype.hasOwnProperty.call(this._items, in_key);\n\t}\n\n\t/**\n\t * Return an item associated with the given key\n\t * @param in_key - the key for the item in this\n\t * Collection\n\t * @returns The item\n\t */\n\titem(in_key: number | string) {\n\t\treturn this._items[in_key];\n\t}\n\n\t/**\n\t * Checks if this is a new key in the collection. Throw if already exists.\n\t * @param in_key - The key to check against\n\t * @returns true if key is new\n\t */\n\tprivate _checkIsNewKey(in_key: number | string) {\n\t\tif (this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_ALREADY_EXISTS} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if the key exists in the collection. Throw if not.\n\t * @param in_key - the key to check against\n\t * @returns true if key exists\n\t */\n\tprivate _checkKeyExists(in_key: number | string) {\n\t\tif (!this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_DOES_NOT_EXIST} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set an existing key to a value. If key doesn't exist this call will throw\n\t * an error.\n\t * @param in_key - The key we want to modify\n\t * @param in_value - The value we are to set at this key\n\t * @returns The value passed in\n\t */\n\tset(in_key: string, in_value: T) {\n\t\tthis._checkKeyExists(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Iterate over this collection and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - A function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerate(in_callback) {\n\t\tfor (const key of this._order) {\n\t\t\tconst continu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Iterate over this collection starting from the tail and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - a function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerateFromTail(in_callback) {\n\t\tlet key;\n\t\tlet continu;\n\t\tfor (let i = this._order.length - 1; i >= 0; i--) {\n\t\t\tkey = this._order[i];\n\t\t\tcontinu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @returns Return an object containing the items of this collection\n\t */\n\tgetItems(): { [key: string]: T } {\n\t\tconst result = {};\n\n\t\t_.each(this._items, function (item, key) {\n\t\t\tresult[key] = item;\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Return the list of keys\n\t * @returns List of keys\n\t */\n\tgetKeys(): string[] {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * Method used to get the first element in the collection along with its key.\n\t */\n\tpeak() {\n\t\treturn {\n\t\t\titem: this._items[this._order[0]],\n\t\t\tkey: this._order[0],\n\t\t};\n\t}\n\n\t/**\n\t * Clear this collection\n\t * @returns this collection\n\t */\n\tclear() {\n\t\tif (_.isEmpty(this._items)) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.onClear(this._items);\n\n\t\t// Best to just iterate through and remove everything, so that OnRemove\n\t\t// handlers are called.\n\n\t\t_.each(this.getKeys(), (key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t * @returns new Collection\n\t */\n\tclone(): Collection<T> {\n\t\tconst newCol = new Collection<T>(this._name, this._type);\n\t\tnewCol.bulkAdd(this._items);\n\t\treturn newCol;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t */\n\tcopy(in_collection: Collection<T>) {\n\t\tthis.clear();\n\t\tconst its = in_collection.items;\n\n\t\t_.each(its, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t}\n\n\tget values() {\n\t\treturn this.getAsArray();\n\t}\n}\n"]}
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,4DAA4D;AAC5D;;GAEG;AACH,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,MAAM,IAAI,GAAG;IACZ,aAAa,EAAE,0CAA0C;IACzD,kBAAkB,EAAE,iCAAiC;IACrD,kBAAkB,EAAE,mDAAmD;IACvE,aAAa,EAAE,yBAAyB;IACxC,eAAe,EAAE,2BAA2B;IAC5C,aAAa,EAAE,sCAAsC;CACrD,CAAC;AAEF,MAAM,OAAO,UAAU;IAItB;;;;;OAKG;IACH,YACW,QAAQ,qBAAqB,EAC7B,KAAqB;QADrB,UAAK,GAAL,KAAK,CAAwB;QAC7B,UAAK,GAAL,KAAK,CAAgB;QAXtB,WAAM,GAAyB,EAAE,CAAC;QAClC,WAAM,GAAwB,EAAE,CAAC;IAWxC,CAAC;IAEJ,4BAA4B;IAC5B,KAAK,CAAC,MAAM,EAAE,QAAQ,IAAG,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,QAAQ,IAAG,CAAC;IAC7B,OAAO,CAAC,QAAQ,IAAG,CAAC;IAEpB,IAAW,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,IAAW,IAAI;QACd,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,MAAuB,EAAE,QAAW;QACvC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;QAC/B,IAAI,CA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AuB;QAEvB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;YAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;OAKG;IACH,KAAK;QACJ,MAAM,MAAM,GAAG,IAAI,UAAU,CAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,aAA4B;QAChC,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC;QAEhC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;YACzB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n/**\n * @fileoverview Collection class definition\n */\nimport _ from \"lodash\";\n\nconst MSGS = {\n\tTYPE_MISMATCH: \"Type does not match this collection type\",\n\tKEY_ALREADY_EXISTS: \"Collection key already exists. \",\n\tKEY_DOES_NOT_EXIST: \"Collection key does not exist in this collection.\",\n\tMUST_GIVE_KEY: \"Collection missing key.\",\n\tMUST_GIVE_VALUE: \"Collection missing value.\",\n\tKEY_NOT_VALID: \"Key must be of type String or Number\",\n};\n\nexport class Collection<T> {\n\tprotected _items: { [key: string]: T } = {};\n\tprotected _order: (string | number)[] = [];\n\n\t/**\n\t * @param _name - a friendly name to describe this collection. If undefined\n\t * the collection will have a default \"Untitled Collection\" assigned to its name.\n\t * @param _type - optional parameter pointing to the constructor\n\t * of a type this Collection will host.\n\t */\n\tconstructor(\n\t\tprotected _name = \"Untitled Collection\",\n\t\tprotected _type?: new () => any,\n\t) {}\n\n\t// Pass-thru binding handles\n\tonAdd(in_key, in_value) {}\n\tonRemove(in_key, in_value) {}\n\tonClear(in_items) {}\n\n\tpublic get items() {\n\t\treturn this._items;\n\t}\n\n\tpublic get keys() {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * @param in_key - Key to store the value under\n\t * @param in_value - Value to store in the collection\n\t * @returns Return the value passed in\n\t */\n\tadd(in_key: number | string, in_value: T): T {\n\t\tthis._checkType(in_value);\n\t\tthis._checkIsNewKey(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\t\tthis._order.push(in_key);\n\n\t\tthis.onAdd(in_key, in_value);\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Checks if in_value's type is equal to this Collection type. If this collection\n\t * has no type set, the check will pass.\n\t *\n\t * @param in_value - A value that is equal to the type managed by this collection.\n\t * @returns Return true if the type is a valid type for this\n\t * collection, throw otherwise.\n\t */\n\tprivate _checkType(in_value: T) {\n\t\tif (this._type && !(in_value instanceof this._type)) {\n\t\t\tthrow new Error(MSGS.TYPE_MISMATCH);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Bulk add items.\n\t * @param in_items - List of key-value pairs to be stored in the collection\n\t * @returns this collection after add\n\t */\n\tbulkAdd(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t\treturn this;\n\t}\n\n\t/**\n\t * Bulk remove items.\n\t * @param in_items - List of key-value items to be removed\n\t * @returns this collection after add\n\t */\n\tbulkRemove(in_items: { [key: string]: T }) {\n\t\t_.each(in_items, (item, key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Test if this collection is empty\n\t * @returns true if empty, false otherwise\n\t * */\n\tisEmpty() {\n\t\treturn _.isEmpty(this._items);\n\t}\n\n\t/**\n\t * Return the first item in the collection, null if empty\n\t * @returns first item, or undefined if empty\n\t * */\n\tgetFirstItem(): T | undefined {\n\t\tconst index = _.first(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * Return the last item in the collection, undefined if empty\n\t * @returns The last item, or undefined if empty\n\t * */\n\tgetLastItem(): T | undefined {\n\t\tconst index = _.last(this._order);\n\t\treturn index === undefined ? index : this._items[index];\n\t}\n\n\t/**\n\t * @returns Returns the type of collection (Array, etc.)\n\t */\n\tgetType() {\n\t\treturn this._type;\n\t}\n\n\t/**\n\t * @returns Returns the name of the collection\n\t */\n\tgetName(): string {\n\t\treturn this._name;\n\t}\n\n\t/**\n\t * Filter out by function\n\t * @param in_filterFunction - with arguments key and item\n\t * @returns A new filtered collection\n\t */\n\tfilter(in_filterFunction: (key: string, item: T) => boolean): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tconst keeper = in_filterFunction(in_key, in_item);\n\t\t\tif (keeper) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterKey\n\t * @param in_filterKey - a single key or an array of keys, if the\n\t * item matches any of the keys it will be filtered in.\n\t * @returns New filtered collection with all the items\n\t * matching at least one key.\n\t */\n\tfilterByKey(in_filterKey: string | string[]): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = _.isArray(in_filterKey)\n\t\t\t? function (in_key, in_item) {\n\t\t\t\t\tif (in_filterKey.includes(in_key)) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: function (in_key, in_item) {\n\t\t\t\t\tif (in_key === in_filterKey) {\n\t\t\t\t\t\trtn.add(in_key, in_item);\n\t\t\t\t\t}\n\t\t\t };\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Filter out all keys NOT matching the in_filterValue\n\t * @param in_filterValue - Value to filter on\n\t * @returns Return a filtered collection\n\t */\n\tfilterByValue(in_filterValue: T): Collection<T> {\n\t\tconst rtn = new Collection<T>();\n\n\t\tconst filterCb = function (in_key, in_item) {\n\t\t\tif (in_item === in_filterValue) {\n\t\t\t\trtn.add(in_key, in_item);\n\t\t\t}\n\t\t};\n\n\t\tthis.iterate(filterCb);\n\n\t\treturn rtn;\n\t}\n\n\t/**\n\t * Remove an item from this Collection. This method returns a Boolean indicating\n\t * the success or failure of the removal. This is practical because if we were\n\t * to throw an error when the key doesn't exist, it would require additional\n\t * checks by the caller to make sure this key exists prior to removal. Which\n\t * would make the attempt of removal more verbose and also costly because the\n\t * caller would have to keep a list – somewhere else – of the things he can\n\t * and cannot remove.\n\t *\n\t * @param in_key - the key we wish to remove\n\t * @returns true if the key exists and was removed, false otherwise.\n\t */\n\tremove(in_key: number | string): boolean {\n\t\tif (!this.has(in_key)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst remember = this._items[in_key];\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete this._items[in_key];\n\t\tthis._order.splice(this._order.indexOf(in_key), 1);\n\n\t\tthis.onRemove(in_key, remember);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Return the number of items in this Collection\n\t * @returns the number of items in the collection\n\t */\n\tgetCount(): number {\n\t\treturn this._order.length;\n\t}\n\n\t/**\n\t * Returns this collection as an ordered Array\n\t * @returns Array including the values\n\t */\n\tgetAsArray() {\n\t\tconst rtnArr: T[] = new Array(this.getCount());\n\n\t\tfor (let i = 0; i < this._order.length; i++) {\n\t\t\trtnArr[i] = this._items[this._order[i]];\n\t\t}\n\n\t\treturn rtnArr;\n\t}\n\n\t/**\n\t * @param in_key - the key we are looking for\n\t * @returns true if the item exists\n\t */\n\thas(in_key: string | number): boolean {\n\t\treturn Object.prototype.hasOwnProperty.call(this._items, in_key);\n\t}\n\n\t/**\n\t * Return an item associated with the given key\n\t * @param in_key - the key for the item in this\n\t * Collection\n\t * @returns The item\n\t */\n\titem(in_key: number | string) {\n\t\treturn this._items[in_key];\n\t}\n\n\t/**\n\t * Checks if this is a new key in the collection. Throw if already exists.\n\t * @param in_key - The key to check against\n\t * @returns true if key is new\n\t */\n\tprivate _checkIsNewKey(in_key: number | string) {\n\t\tif (this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_ALREADY_EXISTS} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if the key exists in the collection. Throw if not.\n\t * @param in_key - the key to check against\n\t * @returns true if key exists\n\t */\n\tprivate _checkKeyExists(in_key: number | string) {\n\t\tif (!this.has(in_key)) {\n\t\t\tthrow new Error(`${MSGS.KEY_DOES_NOT_EXIST} ${in_key}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set an existing key to a value. If key doesn't exist this call will throw\n\t * an error.\n\t * @param in_key - The key we want to modify\n\t * @param in_value - The value we are to set at this key\n\t * @returns The value passed in\n\t */\n\tset(in_key: string, in_value: T) {\n\t\tthis._checkKeyExists(in_key);\n\n\t\tthis._items[in_key] = in_value;\n\n\t\treturn in_value;\n\t}\n\n\t/**\n\t * Iterate over this collection and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - A function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerate(in_callback) {\n\t\tfor (const key of this._order) {\n\t\t\tconst continu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Iterate over this collection starting from the tail and run the callback with passing the key and\n\t * item in the iteration loop.\n\t * @param in_callback - a function that we will call on each item\n\t * of this collection. If the callback returns false then the iteration will exit early.\n\t */\n\titerateFromTail(in_callback) {\n\t\tlet key;\n\t\tlet continu;\n\t\tfor (let i = this._order.length - 1; i >= 0; i--) {\n\t\t\tkey = this._order[i];\n\t\t\tcontinu = in_callback(key, this._items[key]);\n\t\t\tif (continu === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @returns Return an object containing the items of this collection\n\t */\n\tgetItems(): { [key: string]: T } {\n\t\tconst result = {};\n\n\t\t_.each(this._items, function (item, key) {\n\t\t\tresult[key] = item;\n\t\t});\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Return the list of keys\n\t * @returns List of keys\n\t */\n\tgetKeys(): string[] {\n\t\treturn Object.keys(this._items);\n\t}\n\n\t/**\n\t * Method used to get the first element in the collection along with its key.\n\t */\n\tpeak() {\n\t\treturn {\n\t\t\titem: this._items[this._order[0]],\n\t\t\tkey: this._order[0],\n\t\t};\n\t}\n\n\t/**\n\t * Clear this collection\n\t * @returns this collection\n\t */\n\tclear() {\n\t\tif (_.isEmpty(this._items)) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.onClear(this._items);\n\n\t\t// Best to just iterate through and remove everything, so that OnRemove\n\t\t// handlers are called.\n\n\t\t_.each(this.getKeys(), (key) => {\n\t\t\tthis.remove(key);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t * @returns new Collection\n\t */\n\tclone(): Collection<T> {\n\t\tconst newCol = new Collection<T>(this._name, this._type);\n\t\tnewCol.bulkAdd(this._items);\n\t\treturn newCol;\n\t}\n\n\t/**\n\t * Copy the items of in_collection to this collection.\n\t * @param in_collection - the collection we want to\n\t * copy from.\n\t */\n\tcopy(in_collection: Collection<T>) {\n\t\tthis.clear();\n\t\tconst its = in_collection.items;\n\n\t\t_.each(its, (item, key) => {\n\t\t\tthis.add(key, item);\n\t\t});\n\t}\n\n\tget values() {\n\t\treturn this.getAsArray();\n\t}\n}\n"]}
@@ -21,7 +21,7 @@ declare class BaseDataArray {
21
21
  constructor(bufferConstructor: any, size: number);
22
22
  /**
23
23
  * Get the value at an index. If no index is passed, return zeroth item.
24
- * @param in_idx - The specific item in the data array.
24
+ * @param in_idx - The specific item in the data array.
25
25
  * @returns The value at that index.
26
26
  */
27
27
  getValue(in_idx?: number): any;
@@ -27,7 +27,7 @@ class BaseDataArray {
27
27
  }
28
28
  /**
29
29
  * Get the value at an index. If no index is passed, return zeroth item.
30
- * @param in_idx - The specific item in the data array.
30
+ * @param in_idx - The specific item in the data array.
31
31
  * @returns The value at that index.
32
32
  */
33
33
  getValue(in_idx = 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"dataArray.js","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wDAAwD;AACxD,4DAA4D;AAE5D;;GAEG;AAEH;;;GAGG;AACH,MAAM,aAAa;IAYlB,YAAY,CAAC,EAAE,CAAE;QAChB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YAC1B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;YACd,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;SAC9C;aAAM;YACN,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;SACd;QACD,6DAA6D;QAC7D,mDAAmD;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAM,GAAG,CAAC;QAClB,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,GAAG,CAAC,EAAE;YACtC,MAAM,IA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AC;QACnE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,SAAiB,EAAE,QAAQ;QAC9B,IACC,QAAQ,YAAY,WAAW;YAC/B,QAAQ,YAAY,KAAK;YACzB,QAAQ,YAAY,IAAI,CAAC,aAAa,EAAE,EACvC;YACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;SACrD;aAAM,IAAI,QAAQ,YAAY,aAAa,EAAE;YAC7C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;SACjE;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACpF;IACF,CAAC;CACD;AAED,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n\n/**\n * The data arrays definition file.\n */\n\n/**\n * A typed data container that is persistable, high-performance, and can be used\n * as a backing store for collaborative property sets.\n */\nclass BaseDataArray {\n\tprotected _buffer: any;\n\tprivate readonly bufferConstructor;\n\tprotected size: number;\n\n\tconstructor(size: number);\n\n\t/**\n\t * @param bufferConstructor - This is the constructor to be used to setup the internal buffer of the DataArray.\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(a, b?) {\n\t\tif (typeof a === \"number\") {\n\t\t\tthis.size = a;\n\t\t\tthis.bufferConstructor = this.getBufferCtor();\n\t\t} else {\n\t\t\tthis.bufferConstructor = a;\n\t\t\tthis.size = b;\n\t\t}\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tthis._buffer = new this.bufferConstructor(this.size);\n\t}\n\n\t/**\n\t * Get the value at an index. If no index is passed, return zeroth item.\n\t * @param in_idx - The specific item in the data array.\n\t * @returns The value at that index.\n\t */\n\tgetValue(in_idx = 0): any {\n\t\tif (in_idx >= this.size || in_idx < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer[in_idx];\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer.subarray(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * Return the serialized form of Data Arrays.\n\t * @returns An object containing an array of the values.\n\t */\n\tserialize(): number[] {\n\t\treturn Array.from(this._buffer.subarray(0, this.size));\n\t}\n\n\t/**\n\t * Deserialize data from a serialized representation\n\t * @param in_serialized - the serialized representation\n\t */\n\tdeserialize(in_serialized) {\n\t\tconst values = in_serialized;\n\t\tconst length = in_serialized.length;\n\t\tif (length !== this.size) {\n\t\t\tthis.resize(length);\n\t\t\tthis.size = length;\n\t\t}\n\t\tlet i;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis._buffer[i] = values[i];\n\t\t}\n\t}\n\n\t/**\n\t * Set value at an index.\n\t * @param in_idx - the index\n\t * @param in_value - the value we want to set at index\n\t */\n\tsetValue(in_idx: number, in_value) {\n\t\tif (in_idx < this._buffer.length) {\n\t\t\tthis._buffer[in_idx] = in_value;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray setValue in_idx is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * creates a copy of a typed array with removed elements\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - starting index of range that will be removed\n\t * @param in_deleteCount - number of removed elements\n\t * @returns a copy of the input array without the selected range\n\t */\n\tprivate _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size - in_deleteCount;\n\t\tconst splicedArray = new in_arr.constructor(newSize);\n\t\tsplicedArray.set(in_arr.subarray(0, in_offset));\n\t\tsplicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n\t\treturn splicedArray;\n\t}\n\n\t/**\n\t * remove a range of elements from the array\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n\t\t\tthis.size = this.size - in_deleteCount;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * copy an array with elements inserted into the copy\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - the index where the new elements will be inserted\n\t * @param in_addedArray - the array with the elements that will be added\n\t * @returns the combined array\n\t */\n\tprivate _insert(in_arr, in_offset: number, in_addedArray) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size + (in_addedArray.length as number);\n\t\tconst insertedArray = new in_arr.constructor(newSize);\n\t\tinsertedArray.set(in_arr.subarray(0, in_offset));\n\t\tinsertedArray.set(in_addedArray, in_offset);\n\t\tinsertedArray.set(\n\t\t\tin_arr.subarray(in_offset, this.size),\n\t\t\tin_offset + (in_addedArray.length as number),\n\t\t);\n\t\treturn insertedArray;\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array) {\n\t\tthis._buffer = this._insert(this._buffer, in_offset, in_array);\n\t\tthis.size = this.size + (in_array.length as number);\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis._buffer.set(in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis._buffer.set(in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Insert a value at the end of the array, creates a new element at the end and sets the value.\n\t * @param in_value - The new value.\n\t */\n\tpush(in_value) {\n\t\t// Adjust the buffer if necessary\n\t\tconst bufferLength = this._buffer.length;\n\t\tif (this.size > bufferLength - 1) {\n\t\t\tthis._alloc(this.size * 2 || 1); // grow by a factor of 2x\n\t\t}\n\t\t// set the value and update size\n\t\tthis.setValue(this.size, in_value);\n\t\tthis.size++;\n\t}\n\n\t/**\n\t * Get direct access to the data (for performance reasons) this should be uses read only.\n\t * @returns The (read only) raw data.\n\t */\n\tgetBuffer() {\n\t\treturn this._buffer;\n\t}\n\n\t/**\n\t * Get the constructor of the underlying `TypedArray`.\n\t * @returns The constructor for the data buffer.\n\t */\n\tgetBufferCtor() {\n\t\treturn this.bufferConstructor;\n\t}\n\n\t/**\n\t * Apply a given function to all elements of the array.\n\t * @param in_fn - The function that will be applied to every element.\n\t */\n\titerate(in_fn) {\n\t\tconst l = this.size;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tin_fn(this._buffer[i]);\n\t\t}\n\t}\n\n\t/**\n\t * Tet a resized buffer copy.\n\t * @param in_bufferCtor - The constructor for the returned buffer.\n\t * @param in_buffer - The input buffer (won't be modified).\n\t * @param in_newSize - The target size.\n\t * @returns The buffer with the new size.\n\t */\n\tprivate resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n\t\t// target buffer with the desired new size\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tconst newBuffer = new in_bufferCtor(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tnewBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * Allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later).\n\t * @param size - The target allocated space.\n\t * @returns The DataArray itself.\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Change the size of the array\n\t * @param size - The target size\n\t * @returns The DataArray itself\n\t */\n\tresize(size: number) {\n\t\t// this can be costly!!!\n\t\tthis._alloc(size);\n\t\tthis.size = size;\n\t\treturn this;\n\t}\n\n\tcopy() {\n\t\t// and this!\n\t\tconst newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n\t\tnewBuffer.set(this._buffer);\n\t\treturn newBuffer;\n\t}\n\n\tget length() {\n\t\treturn this.size;\n\t}\n}\n\nclass Int8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int8Array, size);\n\t}\n}\n\nclass Int16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int16Array, size);\n\t}\n}\n\nclass Int32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int32Array, size);\n\t}\n}\n\nclass Uint8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint8Array, size);\n\t}\n}\n\nclass Uint16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint16Array, size);\n\t}\n}\n\nclass Uint32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint32Array, size);\n\t}\n}\n\nclass Float32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float32Array, size);\n\t}\n}\n\nclass Float64DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float64Array, size);\n\t}\n}\n\n/**\n * A data container that can contain every native type\n *\n * @param size - The initial size with which to allocate the array.\n */\nclass UniversalDataArray extends BaseDataArray {\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(size: number);\n\tconstructor(a?, b?) {\n\t\tif (b === undefined) {\n\t\t\tsuper(Array, a);\n\t\t} else {\n\t\t\tsuper(a, b);\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to write array values into another array at a given offset.\n\t *\n\t * @param array - The target array.\n\t * @param values - The values we need to write.\n\t * @param offset - The starting index in target array.\n\t */\n\tprivate arraySet(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = value;\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * Insert the content of an array into the DataArray.\n\t * @param in_offset - The target index.\n\t * @param in_array - The array to be inserted.\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Eemove a range of elements from the array.\n\t * @param in_offset - The start of the range.\n\t * @param in_deleteCount - The number of elements to be removed.\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer.splice(in_offset, in_deleteCount);\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start\n\t * setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySet(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n\t * @param in_buffer - input buffer - not changed\n\t * @param in_newSize - target size\n\t * @returns an Array of the new size\n\t */\n\tprivate resizeBufferArray(in_buffer, in_newSize) {\n\t\t// target buffer with the desired new size\n\t\tconst newBuffer = new Array(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tthis.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later)\n\t * @param size - the target allocated space\n\t * @returns the DataArray itself\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBufferArray(this._buffer, size);\n\t\treturn this;\n\t}\n}\n\n/**\n * A data container that contains a string\n */\nclass StringDataArray extends BaseDataArray {\n\tconstructor() {\n\t\tsuper(String, 0);\n\t\tthis.size = 0;\n\t\tthis._buffer = \"\";\n\t}\n\t/**\n\t * insert the content of a string into the StringDataArray\n\t * @param in_offset - the target index\n\t * @param in_string - the string to be inserted\n\t */\n\tinsertRange(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset,\n\t\t)}`;\n\t\tthis.size = this.size + in_string.length;\n\t}\n\n\t/**\n\t * remove a range of elements from the string\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(\n\t\t\t\tin_offset + in_deleteCount,\n\t\t\t)}`;\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_string values.\n\t * @param in_offset - The offset in this array to begin start setting this arrays values to in_string values.\n\t * @param in_string - The input string.\n\t */\n\tset(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset + in_string.length,\n\t\t)}`;\n\t}\n\n\t/**\n\t * Return a range of characters in the string.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the characters in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number): string {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\tget length() {\n\t\treturn this._buffer.length;\n\t}\n}\n\n/**\n * A data container that can contain boolean type\n */\nclass BoolDataArray extends UniversalDataArray {\n\t/**\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(size: number) {\n\t\tsuper(Array, size);\n\t}\n\n\t/**\n\t * helper function to write and cast to boolean array values into another array at a given offset\n\t * @param array - target array\n\t * @param values - the values we need to write\n\t * @param offset - starting index in target array\n\t */\n\tprivate arraySetBool(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = !!(value as boolean);\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tconst toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(toBeAdded));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySetBool(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n}\n\nexport {\n\tBaseDataArray,\n\tFloat32DataArray,\n\tFloat64DataArray,\n\tInt8DataArray,\n\tInt16DataArray,\n\tInt32DataArray,\n\tUint8DataArray,\n\tUint16DataArray,\n\tUint32DataArray,\n\tUniversalDataArray,\n\tStringDataArray,\n\tBoolDataArray,\n};\n"]}
1
+ {"version":3,"file":"dataArray.js","sourceRoot":"","sources":["../../src/datastructures/dataArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wDAAwD;AACxD,4DAA4D;AAE5D;;GAEG;AAEH;;;GAGG;AACH,MAAM,aAAa;IAYlB,YAAY,CAAC,EAAE,CAAE;QAChB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YAC1B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;YACd,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;SAC9C;aAAM;YACN,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;SACd;QACD,6DAA6D;QAC7D,mDAAmD;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,MAAM,GAAG,CAAC;QAClB,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,IAAI,MAAM,GAAG,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACnD;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,WAAmB,EAAE,SAAiB;QACnD,IAAI,WAAW,IAAI,IAAI,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IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,SAAiB,EAAE,QAAQ;QAC9B,IACC,QAAQ,YAAY,WAAW;YAC/B,QAAQ,YAAY,KAAK;YACzB,QAAQ,YAAY,IAAI,CAAC,aAAa,EAAE,EACvC;YACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;SACrD;aAAM,IAAI,QAAQ,YAAY,aAAa,EAAE;YAC7C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;SACjE;aAAM;YACN,OAAO,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;SACpF;IACF,CAAC;CACD;AAED,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint accessor-pairs: [2, { \"getWithoutSet\": false }] */\n\n/**\n * The data arrays definition file.\n */\n\n/**\n * A typed data container that is persistable, high-performance, and can be used\n * as a backing store for collaborative property sets.\n */\nclass BaseDataArray {\n\tprotected _buffer: any;\n\tprivate readonly bufferConstructor;\n\tprotected size: number;\n\n\tconstructor(size: number);\n\n\t/**\n\t * @param bufferConstructor - This is the constructor to be used to setup the internal buffer of the DataArray.\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(a, b?) {\n\t\tif (typeof a === \"number\") {\n\t\t\tthis.size = a;\n\t\t\tthis.bufferConstructor = this.getBufferCtor();\n\t\t} else {\n\t\t\tthis.bufferConstructor = a;\n\t\t\tthis.size = b;\n\t\t}\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tthis._buffer = new this.bufferConstructor(this.size);\n\t}\n\n\t/**\n\t * Get the value at an index. If no index is passed, return zeroth item.\n\t * @param in_idx - The specific item in the data array.\n\t * @returns The value at that index.\n\t */\n\tgetValue(in_idx = 0): any {\n\t\tif (in_idx >= this.size || in_idx < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer[in_idx];\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\n\t\treturn this._buffer.subarray(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * Return the serialized form of Data Arrays.\n\t * @returns An object containing an array of the values.\n\t */\n\tserialize(): number[] {\n\t\treturn Array.from(this._buffer.subarray(0, this.size));\n\t}\n\n\t/**\n\t * Deserialize data from a serialized representation\n\t * @param in_serialized - the serialized representation\n\t */\n\tdeserialize(in_serialized) {\n\t\tconst values = in_serialized;\n\t\tconst length = in_serialized.length;\n\t\tif (length !== this.size) {\n\t\t\tthis.resize(length);\n\t\t\tthis.size = length;\n\t\t}\n\t\tlet i;\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis._buffer[i] = values[i];\n\t\t}\n\t}\n\n\t/**\n\t * Set value at an index.\n\t * @param in_idx - the index\n\t * @param in_value - the value we want to set at index\n\t */\n\tsetValue(in_idx: number, in_value) {\n\t\tif (in_idx < this._buffer.length) {\n\t\t\tthis._buffer[in_idx] = in_value;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray setValue in_idx is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * creates a copy of a typed array with removed elements\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - starting index of range that will be removed\n\t * @param in_deleteCount - number of removed elements\n\t * @returns a copy of the input array without the selected range\n\t */\n\tprivate _removeElementsFromArray(in_arr, in_offset: number, in_deleteCount: number) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size - in_deleteCount;\n\t\tconst splicedArray = new in_arr.constructor(newSize);\n\t\tsplicedArray.set(in_arr.subarray(0, in_offset));\n\t\tsplicedArray.set(in_arr.subarray(in_offset + in_deleteCount, this.size), in_offset);\n\t\treturn splicedArray;\n\t}\n\n\t/**\n\t * remove a range of elements from the array\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = this._removeElementsFromArray(this._buffer, in_offset, in_deleteCount);\n\t\t\tthis.size = this.size - in_deleteCount;\n\t\t} else {\n\t\t\tconsole.error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * copy an array with elements inserted into the copy\n\t * @param in_arr - the input array (won't be modified)\n\t * @param in_offset - the index where the new elements will be inserted\n\t * @param in_addedArray - the array with the elements that will be added\n\t * @returns the combined array\n\t */\n\tprivate _insert(in_arr, in_offset: number, in_addedArray) {\n\t\t// TODO: this function can be optimized\n\t\tconst newSize = this.size + (in_addedArray.length as number);\n\t\tconst insertedArray = new in_arr.constructor(newSize);\n\t\tinsertedArray.set(in_arr.subarray(0, in_offset));\n\t\tinsertedArray.set(in_addedArray, in_offset);\n\t\tinsertedArray.set(\n\t\t\tin_arr.subarray(in_offset, this.size),\n\t\t\tin_offset + (in_addedArray.length as number),\n\t\t);\n\t\treturn insertedArray;\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array) {\n\t\tthis._buffer = this._insert(this._buffer, in_offset, in_array);\n\t\tthis.size = this.size + (in_array.length as number);\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis._buffer.set(in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis._buffer.set(in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Insert a value at the end of the array, creates a new element at the end and sets the value.\n\t * @param in_value - The new value.\n\t */\n\tpush(in_value) {\n\t\t// Adjust the buffer if necessary\n\t\tconst bufferLength = this._buffer.length;\n\t\tif (this.size > bufferLength - 1) {\n\t\t\tthis._alloc(this.size * 2 || 1); // grow by a factor of 2x\n\t\t}\n\t\t// set the value and update size\n\t\tthis.setValue(this.size, in_value);\n\t\tthis.size++;\n\t}\n\n\t/**\n\t * Get direct access to the data (for performance reasons) this should be uses read only.\n\t * @returns The (read only) raw data.\n\t */\n\tgetBuffer() {\n\t\treturn this._buffer;\n\t}\n\n\t/**\n\t * Get the constructor of the underlying `TypedArray`.\n\t * @returns The constructor for the data buffer.\n\t */\n\tgetBufferCtor() {\n\t\treturn this.bufferConstructor;\n\t}\n\n\t/**\n\t * Apply a given function to all elements of the array.\n\t * @param in_fn - The function that will be applied to every element.\n\t */\n\titerate(in_fn) {\n\t\tconst l = this.size;\n\t\tfor (let i = 0; i < l; i++) {\n\t\t\tin_fn(this._buffer[i]);\n\t\t}\n\t}\n\n\t/**\n\t * Tet a resized buffer copy.\n\t * @param in_bufferCtor - The constructor for the returned buffer.\n\t * @param in_buffer - The input buffer (won't be modified).\n\t * @param in_newSize - The target size.\n\t * @returns The buffer with the new size.\n\t */\n\tprivate resizeBuffer(in_bufferCtor, in_buffer, in_newSize: number) {\n\t\t// target buffer with the desired new size\n\t\t// The 'eslint-...' is used to disable the rule that requires\n\t\t// constructors to start with a capitalized letter.\n\t\tconst newBuffer = new in_bufferCtor(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tnewBuffer.set(isShrinking ? oldBuffer.subarray(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * Allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later).\n\t * @param size - The target allocated space.\n\t * @returns The DataArray itself.\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBuffer(this.bufferConstructor, this._buffer, size);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Change the size of the array\n\t * @param size - The target size\n\t * @returns The DataArray itself\n\t */\n\tresize(size: number) {\n\t\t// this can be costly!!!\n\t\tthis._alloc(size);\n\t\tthis.size = size;\n\t\treturn this;\n\t}\n\n\tcopy() {\n\t\t// and this!\n\t\tconst newBuffer = new this.bufferConstructor(this.size); // buffer with the desired new size\n\t\tnewBuffer.set(this._buffer);\n\t\treturn newBuffer;\n\t}\n\n\tget length() {\n\t\treturn this.size;\n\t}\n}\n\nclass Int8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int8Array, size);\n\t}\n}\n\nclass Int16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int16Array, size);\n\t}\n}\n\nclass Int32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Int32Array, size);\n\t}\n}\n\nclass Uint8DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint8Array, size);\n\t}\n}\n\nclass Uint16DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint16Array, size);\n\t}\n}\n\nclass Uint32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Uint32Array, size);\n\t}\n}\n\nclass Float32DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float32Array, size);\n\t}\n}\n\nclass Float64DataArray extends BaseDataArray {\n\tconstructor(size: number) {\n\t\tsuper(Float64Array, size);\n\t}\n}\n\n/**\n * A data container that can contain every native type\n *\n * @param size - The initial size with which to allocate the array.\n */\nclass UniversalDataArray extends BaseDataArray {\n\tconstructor(bufferConstructor: any, size: number);\n\tconstructor(size: number);\n\tconstructor(a?, b?) {\n\t\tif (b === undefined) {\n\t\t\tsuper(Array, a);\n\t\t} else {\n\t\t\tsuper(a, b);\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to write array values into another array at a given offset.\n\t *\n\t * @param array - The target array.\n\t * @param values - The values we need to write.\n\t * @param offset - The starting index in target array.\n\t */\n\tprivate arraySet(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = value;\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * Insert the content of an array into the DataArray.\n\t * @param in_offset - The target index.\n\t * @param in_array - The array to be inserted.\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(in_array));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Eemove a range of elements from the array.\n\t * @param in_offset - The start of the range.\n\t * @param in_deleteCount - The number of elements to be removed.\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer.splice(in_offset, in_deleteCount);\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start\n\t * setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySet(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySet(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n\n\t/**\n\t * Return a range of values in the array.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the array of values in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number) {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\t/**\n\t * change the size of a javascript array and keep the content, if possible. Keeps the input buffer.\n\t * @param in_buffer - input buffer - not changed\n\t * @param in_newSize - target size\n\t * @returns an Array of the new size\n\t */\n\tprivate resizeBufferArray(in_buffer, in_newSize) {\n\t\t// target buffer with the desired new size\n\t\tconst newBuffer = new Array(in_newSize);\n\t\tconst oldSize = in_buffer.length;\n\t\tconst oldBuffer = in_buffer;\n\t\tconst isShrinking = oldSize > in_newSize;\n\t\tthis.arraySet(newBuffer, isShrinking ? oldBuffer.slice(0, in_newSize) : oldBuffer);\n\t\treturn newBuffer;\n\t}\n\n\t/**\n\t * allocate memory for the array (for performance reasons, you can allocate more space than the current length,\n\t * which makes pushes to the array less expensive later)\n\t * @param size - the target allocated space\n\t * @returns the DataArray itself\n\t */\n\tprotected _alloc(size: number): any {\n\t\tthis._buffer = this.resizeBufferArray(this._buffer, size);\n\t\treturn this;\n\t}\n}\n\n/**\n * A data container that contains a string\n */\nclass StringDataArray extends BaseDataArray {\n\tconstructor() {\n\t\tsuper(String, 0);\n\t\tthis.size = 0;\n\t\tthis._buffer = \"\";\n\t}\n\t/**\n\t * insert the content of a string into the StringDataArray\n\t * @param in_offset - the target index\n\t * @param in_string - the string to be inserted\n\t */\n\tinsertRange(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset,\n\t\t)}`;\n\t\tthis.size = this.size + in_string.length;\n\t}\n\n\t/**\n\t * remove a range of elements from the string\n\t * @param in_offset - start of the range\n\t * @param in_deleteCount - number of elements to be removed\n\t */\n\tremoveRange(in_offset: number, in_deleteCount: number) {\n\t\tif (in_offset + in_deleteCount < (this._buffer.length as number) + 1) {\n\t\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${this._buffer.substr(\n\t\t\t\tin_offset + in_deleteCount,\n\t\t\t)}`;\n\t\t\tthis.size -= in_deleteCount;\n\t\t} else {\n\t\t\tthrow Error(\"DataArray removeRange in_offset + in_deleteCount is out of bounds.\");\n\t\t}\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_string values.\n\t * @param in_offset - The offset in this array to begin start setting this arrays values to in_string values.\n\t * @param in_string - The input string.\n\t */\n\tset(in_offset: number, in_string: string) {\n\t\tthis._buffer = `${this._buffer.substr(0, in_offset)}${in_string}${this._buffer.substr(\n\t\t\tin_offset + in_string.length,\n\t\t)}`;\n\t}\n\n\t/**\n\t * Return a range of characters in the string.\n\t * @param in_idxStart - the starting index\n\t * @param in_idxEnd - the end index - this offset is exclusive\n\t * @returns the characters in the range\n\t */\n\tgetValueRange(in_idxStart: number, in_idxEnd: number): string {\n\t\tif (in_idxStart >= this.size || in_idxEnd > this.size || in_idxStart < 0 || in_idxEnd < 0) {\n\t\t\tthrow new Error(\"Trying to access out of bounds!\");\n\t\t}\n\t\treturn this._buffer.slice(in_idxStart, in_idxEnd);\n\t}\n\n\tget length() {\n\t\treturn this._buffer.length;\n\t}\n}\n\n/**\n * A data container that can contain boolean type\n */\nclass BoolDataArray extends UniversalDataArray {\n\t/**\n\t * @param size - The initial size with which to allocate the array.\n\t */\n\tconstructor(size: number) {\n\t\tsuper(Array, size);\n\t}\n\n\t/**\n\t * helper function to write and cast to boolean array values into another array at a given offset\n\t * @param array - target array\n\t * @param values - the values we need to write\n\t * @param offset - starting index in target array\n\t */\n\tprivate arraySetBool(array, values, offset = 0) {\n\t\tlet index = 0;\n\t\tvalues.forEach(function (value) {\n\t\t\tarray[index + offset] = !!(value as boolean);\n\t\t\tindex++;\n\t\t});\n\t}\n\n\t/**\n\t * insert the content of an array into the DataArray\n\t * @param in_offset - the target index\n\t * @param in_array - the array to be inserted\n\t */\n\tinsertRange(in_offset: number, in_array: any[]) {\n\t\tconst toBeAdded: any[] = in_array.map((val) => !!(val as boolean));\n\t\tthis._buffer.splice.call(this._buffer, ...[in_offset, 0].concat(toBeAdded));\n\t\tthis.size = this.size + in_array.length;\n\t}\n\n\t/**\n\t * Set this array values to be equal to in_array values.\n\t * @param in_offset - An optional offset in this array to begin start setting this arrays values to in_array values.\n\t * @param in_array - The input array.\n\t */\n\tset(in_offset: number, in_array) {\n\t\tif (\n\t\t\tin_array instanceof ArrayBuffer ||\n\t\t\tin_array instanceof Array ||\n\t\t\tin_array instanceof this.getBufferCtor()\n\t\t) {\n\t\t\tthis.arraySetBool(this._buffer, in_array, in_offset);\n\t\t} else if (in_array instanceof BaseDataArray) {\n\t\t\tthis.arraySetBool(this._buffer, in_array.getBuffer(), in_offset);\n\t\t} else {\n\t\t\tconsole.error(\"DataArray set() must be called with Array, TypedArray or DataArray\");\n\t\t}\n\t}\n}\n\nexport {\n\tBaseDataArray,\n\tFloat32DataArray,\n\tFloat64DataArray,\n\tInt8DataArray,\n\tInt16DataArray,\n\tInt32DataArray,\n\tUint8DataArray,\n\tUint16DataArray,\n\tUint32DataArray,\n\tUniversalDataArray,\n\tStringDataArray,\n\tBoolDataArray,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;;;;;;;GAUG;AACH,qBAAa,SAAS;IACT,SAAS,CAAC,GAAG;IAAM,SAAS,CAAC,IAAI;gBAAvB,GAAG,SAAI,EAAY,IAAI,SAAI;IAEjD;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;GAEG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,cAAwB,MAAM,2BAG7C;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGnB;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGd"}
1
+ {"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;;;;;;;GAUG;AACH,qBAAa,SAAS;IAEpB,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,IAAI;gBADJ,GAAG,SAAI,EACP,IAAI,SAAI;IAGnB;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;GAEG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,cAAwB,MAAM,2BAG7C;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGnB;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGd"}
@@ -82,7 +82,7 @@ function _stringToInt64(in_signed, in_string, in_radix = 10) {
82
82
  let negative = false;
83
83
  let high = 0;
84
84
  let low = 0;
85
- if (string[0] === "-") {
85
+ if (string.startsWith("-")) {
86
86
  negative = true;
87
87
  position += 1;
88
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,OAAO,SAAS;IACrB,YAAsB,MAAM,CAAC,EAAY,OAAO,CAAC;QAA3B,QAAG,GAAH,GAAG,CAAI;QAAY,SAAI,GAAJ,IAAI,CAAI;IAAG,CAAC;IAErD;;OAEG;IACH,YAAY;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,IAAI,CAAC,GAAG,CAAC;IACjB,CAAC;IAES,cAAc,CAAC,QAAiB,EAAE,QAAQ,GAAG,EAAE;QACxD,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAG,CAAC,uBAAuB,IAAI,QAAQ,EAAE,CAAC,CAAC;Q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.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview implements (U)Int64 Datastructures\n */\n\nimport _ from \"lodash\";\nimport { ConsoleUtils } from \"../consoleUtils\";\nimport { constants } from \"../constants\";\n\nconst BIT32 = 4294967296;\nconst { MSG } = constants;\n\n/**\n * A data representation class for 64 bit integer types.\n *\n * @remarks This is necessary since js doesn't support 64bit integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions! (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n */\nexport class Integer64 {\n\tconstructor(protected low = 0, protected high = 0) {}\n\n\t/**\n\t * @returns The higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this.high;\n\t}\n\n\t/**\n\t * @returns The lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this.low;\n\t}\n\n\tprotected _int64toString(isSigned: boolean, in_radix = 10): string {\n\t\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n\t\tConsoleUtils.assert(\n\t\t\tin_radix >= 2 && 36 >= in_radix,\n\t\t\t`${MSG.BASE_OUT_OF_RANGE} ${in_radix}`,\n\t\t);\n\n\t\tlet high = this.getValueHigh();\n\t\tlet low = this.getValueLow();\n\t\tlet result = \"\";\n\t\tconst sign = !!(isSigned && high & 0x80000000); // eslint-disable-line no-bitwise\n\t\tif (sign) {\n\t\t\thigh = ~high; // eslint-disable-line no-bitwise\n\t\t\tlow = BIT32 - low;\n\t\t}\n\t\tdo {\n\t\t\tconst mod = (high % in_radix) * BIT32 + low;\n\t\t\thigh = Math.floor(high / in_radix);\n\t\t\tlow = Math.floor(mod / in_radix);\n\t\t\tresult = (mod % in_radix).toString(in_radix) + result;\n\t\t} while (high || low);\n\n\t\treturn sign ? `-${result}` : result;\n\t}\n}\n\n/**\n * stringToInt function parses a string argument updates object's lower and higher 32 bit integer parts.\n *\n * @param in_signed - If the expect response should be signed or unsigned.\n * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.\n * @param in_radix - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above mentioned string.\n *\n * @throws If `in_string` is not a string.\n * @throws If `in_radix` is entered but is not a number between 2 and 36.\n * @throws If the property is a `Uint64` property and `in_string` is a negative number.\n * @throws If `in_string` contains characters other than numbers.\n *\n * @returns Low and high bits of `Int64`.\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\tconst string = in_string.trim();\n\n\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n\tConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n\tlet position = 0;\n\tlet negative = false;\n\tlet high = 0;\n\tlet low = 0;\n\tif (string[0] === \"-\") {\n\t\tnegative = true;\n\t\tposition += 1;\n\t}\n\n\tConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n\twhile (position < string.length) {\n\t\tconst digit = parseInt(string[position++], in_radix);\n\t\tif (isNaN(digit)) {\n\t\t\tthrow new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n\t\t}\n\t\tlow = low * in_radix + digit;\n\t\thigh = high * in_radix + Math.floor(low / BIT32);\n\t\tlow %= BIT32;\n\t}\n\n\tif (negative) {\n\t\t// eslint-disable-next-line no-bitwise\n\t\thigh = ~high;\n\t\tif (low) {\n\t\t\tlow = BIT32 - low;\n\t\t} else {\n\t\t\thigh += 1;\n\t\t}\n\t}\n\n\treturn [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n */\nexport class Int64 extends Integer64 {\n\tstatic fromString = function (in_string: string, radix = 10) {\n\t\tconst [low, high] = _stringToInt64(true, in_string, radix);\n\t\treturn new Int64(low, high);\n\t};\n\n\tclone() {\n\t\treturn new Int64(this.low, this.high);\n\t}\n\n\ttoString(radix = 10) {\n\t\treturn this._int64toString(true, radix);\n\t}\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n */\nexport class Uint64 extends Integer64 {\n\tstatic fromString(in_string: string, in_radix = 10) {\n\t\tconst [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n\t\treturn new Uint64(low, high);\n\t}\n\n\tclone() {\n\t\treturn new Uint64(this.low, this.high);\n\t}\n\n\ttoString(radix) {\n\t\treturn this._int64toString(false, radix);\n\t}\n}\n"]}
1
+ {"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,OAAO,SAAS;IACrB,YACW,MAAM,CAAC,EACP,OAAO,CAAC;QADR,QAAG,GAAH,GAAG,CAAI;QACP,SAAI,GAAJ,IAAI,CAAI;IAChB,CAAC;IAEJ;;OAEG;IACH,YAAY;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,IAAI,CAAC,GAAG,CAAC;IACjB,CAAC;IAES,cAAc,CAAC,QAAiB,EAAE,QAAQ,GAAG,EAAE;QACxD,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAG,CAAC,uBAAuB,IAAI,QAAQ,EAAE,CAAC,CAAC;QACxF,YAAY,CAAC,MAAM,CAClB,QAAQ,IAAI,CAAC,IAAI,EAAE,IAAI,QAAQ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C;SACV;KACD;IAED,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,SAAS;IAMnC,KAAK;QACJ,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,QAAQ,CAAC,KAAK,GAAG,EAAE;QAClB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;;AAXM,gBAAU,GAAG,UAAU,SAAiB,EAAE,KAAK,GAAG,EAAE;IAC1D,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAWH;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAiB,EAAE,QAAQ,GAAG,EAAE;QACjD,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC1E,OAAO,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,KAAK;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview implements (U)Int64 Datastructures\n */\n\nimport _ from \"lodash\";\nimport { ConsoleUtils } from \"../consoleUtils\";\nimport { constants } from \"../constants\";\n\nconst BIT32 = 4294967296;\nconst { MSG } = constants;\n\n/**\n * A data representation class for 64 bit integer types.\n *\n * @remarks This is necessary since js doesn't support 64bit integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions! (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n */\nexport class Integer64 {\n\tconstructor(\n\t\tprotected low = 0,\n\t\tprotected high = 0,\n\t) {}\n\n\t/**\n\t * @returns The higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this.high;\n\t}\n\n\t/**\n\t * @returns The lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this.low;\n\t}\n\n\tprotected _int64toString(isSigned: boolean, in_radix = 10): string {\n\t\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n\t\tConsoleUtils.assert(\n\t\t\tin_radix >= 2 && 36 >= in_radix,\n\t\t\t`${MSG.BASE_OUT_OF_RANGE} ${in_radix}`,\n\t\t);\n\n\t\tlet high = this.getValueHigh();\n\t\tlet low = this.getValueLow();\n\t\tlet result = \"\";\n\t\tconst sign = !!(isSigned && high & 0x80000000); // eslint-disable-line no-bitwise\n\t\tif (sign) {\n\t\t\thigh = ~high; // eslint-disable-line no-bitwise\n\t\t\tlow = BIT32 - low;\n\t\t}\n\t\tdo {\n\t\t\tconst mod = (high % in_radix) * BIT32 + low;\n\t\t\thigh = Math.floor(high / in_radix);\n\t\t\tlow = Math.floor(mod / in_radix);\n\t\t\tresult = (mod % in_radix).toString(in_radix) + result;\n\t\t} while (high || low);\n\n\t\treturn sign ? `-${result}` : result;\n\t}\n}\n\n/**\n * stringToInt function parses a string argument updates object's lower and higher 32 bit integer parts.\n *\n * @param in_signed - If the expect response should be signed or unsigned.\n * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.\n * @param in_radix - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above mentioned string.\n *\n * @throws If `in_string` is not a string.\n * @throws If `in_radix` is entered but is not a number between 2 and 36.\n * @throws If the property is a `Uint64` property and `in_string` is a negative number.\n * @throws If `in_string` contains characters other than numbers.\n *\n * @returns Low and high bits of `Int64`.\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\tconst string = in_string.trim();\n\n\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n\tConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n\tlet position = 0;\n\tlet negative = false;\n\tlet high = 0;\n\tlet low = 0;\n\tif (string.startsWith(\"-\")) {\n\t\tnegative = true;\n\t\tposition += 1;\n\t}\n\n\tConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n\twhile (position < string.length) {\n\t\tconst digit = parseInt(string[position++], in_radix);\n\t\tif (isNaN(digit)) {\n\t\t\tthrow new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n\t\t}\n\t\tlow = low * in_radix + digit;\n\t\thigh = high * in_radix + Math.floor(low / BIT32);\n\t\tlow %= BIT32;\n\t}\n\n\tif (negative) {\n\t\t// eslint-disable-next-line no-bitwise\n\t\thigh = ~high;\n\t\tif (low) {\n\t\t\tlow = BIT32 - low;\n\t\t} else {\n\t\t\thigh += 1;\n\t\t}\n\t}\n\n\treturn [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n */\nexport class Int64 extends Integer64 {\n\tstatic fromString = function (in_string: string, radix = 10) {\n\t\tconst [low, high] = _stringToInt64(true, in_string, radix);\n\t\treturn new Int64(low, high);\n\t};\n\n\tclone() {\n\t\treturn new Int64(this.low, this.high);\n\t}\n\n\ttoString(radix = 10) {\n\t\treturn this._int64toString(true, radix);\n\t}\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n */\nexport class Uint64 extends Integer64 {\n\tstatic fromString(in_string: string, in_radix = 10) {\n\t\tconst [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n\t\treturn new Uint64(low, high);\n\t}\n\n\tclone() {\n\t\treturn new Uint64(this.low, this.high);\n\t}\n\n\ttoString(radix) {\n\t\treturn this._int64toString(false, radix);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,OAAO,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IAbA;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA5BD;;GAEG;AACI,kBAAK,GAAG;IACd;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACR,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 */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
1
+ {"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,OAAO,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IAbA;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA5BD;;GAEG;AACI,kBAAK,GAAG;IACd;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACR,AATW,CASV","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Checks if a flag is set\n * @param flags - Flags set within an error object\n * @param flag - A flag to be checked\n * @returns True if the flag is set in passed flags, false otherwise.\n */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;IACN,UAAU,CAAC;IACX,aAAa,CAAC;IACd,MAAM,CAAC;IACP,GAAG,CAAC;IACJ,KAAK;gBALL,KAAK,CAAC,oBAAQ,EACd,UAAU,CAAC,oBAAQ,EACnB,aAAa,CAAC,oBAAQ,EACtB,MAAM,CAAC,oBAAQ,EACf,GAAG,CAAC,oBAAQ,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAWlB"}
1
+ {"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;IACN,UAAU,CAAC;IACX,aAAa,CAAC;IACd,MAAM,CAAC;IACP,GAAG,CAAC;IACJ,KAAK;gBALL,KAAK,CAAC,oBAAQ,EACd,UAAU,CAAC,oBAAQ,EACnB,aAAa,CAAC,oBAAQ,EACtB,MAAM,CAAC,oBAAQ,EACf,GAAG,CAAC,oBAAQ,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAYlB"}
@@ -47,7 +47,9 @@ export class HTTPError extends Error {
47
47
  */
48
48
  toString() {
49
49
  const stack = this.stack === undefined ? "" : String(this.stack);
50
- const isFirefox = typeof window !== "undefined" &&
50
+ const isFirefox =
51
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain causes a test failure
52
+ typeof window !== "undefined" &&
51
53
  typeof window.navigator !== "undefined" &&
52
54
  typeof window.navigator.userAgent !== "undefined" &&
53
55
  window.navigator.userAgent.toLowerCase().includes("firefox");
@@ -1 +1 @@
1
- {"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACnC,YACQ,KAAc,EACd,UAAmB,EACnB,aAAsB,EACtB,MAAe,EACf,GAAY,EACZ,QAAQ,CAAC;QAEhB,KAAK,EAAE,CAAC;QAPD,UAAK,GAAL,KAAK,CAAS;QACd,eAAU,GAAV,UAAU,CAAS;QACnB,kBAAa,GAAb,aAAa,CAAS;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E,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAEpD,OAAO,CACN,cAAc,QAAQ,gBAAgB,aAAa,IAAI;YACvD,iBAAiB,gBAAgB,YAAY,SAAS,SAAS,MAAM,EAAE,CACvE,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,QAAQ;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjE,MAAM,SAAS,GACd,OAAO,MAAM,KAAK,WAAW;YAC7B,OAAO,MAAM,CAAC,SAAS,KAAK,WAAW;YACvC,OAAO,MAAM,CAAC,SAAS,CAAC,SAAS,KAAK,WAAW;YACjD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC;IACzE,CAAC;;AArCM,eAAK,GAAG,YAAY,CAAC,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { FlaggedError } from \"./flaggedError\";\n\n/**\n * Class extending Error with HTTP-specific error information like statusCode and statusMessage\n * @param title - The error title\n * @param statusCode - A numeric HTTP status code\n * @param statusMessage - A string message representing the response status message\n * @param method - The HTTP method used in the request\n * @param url - The URL that the request was sent to\n * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n */\nexport class HTTPError extends Error {\n\tconstructor(\n\t\tpublic title?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic statusMessage?: string,\n\t\tpublic method?: string,\n\t\tpublic url?: string,\n\t\tpublic flags = 0,\n\t) {\n\t\tsuper();\n\t\tObject.setPrototypeOf(this, HTTPError.prototype);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.message = this._generateMessage(title, statusCode, statusMessage, method, url);\n\t\tthis.stack = new Error(this.message).stack;\n\t}\n\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\tisQuiet(): boolean {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient(): boolean {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\tprivate _generateMessage(title, statusCode, statusMessage, method, url) {\n\t\tconst titleStr = title === undefined ? \"\" : String(title);\n\t\tconst statusCodeStr = statusCode === undefined ? \"\" : String(statusCode);\n\t\tconst statusMessageStr = statusMessage === undefined ? \"\" : String(statusMessage);\n\t\tconst methodStr = method === undefined ? \"\" : String(method);\n\t\tconst urlStr = url === undefined ? \"\" : String(url);\n\n\t\treturn (\n\t\t\t`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +\n\t\t\t`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`\n\t\t);\n\t}\n\n\t/**\n\t * Returns a string representing the HTTPError object\n\t * @returns a string representing the HTTPError object\n\t */\n\ttoString(): string {\n\t\tconst stack = this.stack === undefined ? \"\" : String(this.stack);\n\n\t\tconst isFirefox =\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\ttypeof window.navigator !== \"undefined\" &&\n\t\t\ttypeof window.navigator.userAgent !== \"undefined\" &&\n\t\t\twindow.navigator.userAgent.toLowerCase().includes(\"firefox\");\n\n\t\treturn isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;\n\t}\n}\n"]}
1
+ {"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACnC,YACQ,KAAc,EACd,UAAmB,EACnB,aAAsB,EACtB,MAAe,EAC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SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAEpD,OAAO,CACN,cAAc,QAAQ,gBAAgB,aAAa,IAAI;YACvD,iBAAiB,gBAAgB,YAAY,SAAS,SAAS,MAAM,EAAE,CACvE,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,QAAQ;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjE,MAAM,SAAS;QACd,4GAA4G;QAC5G,OAAO,MAAM,KAAK,WAAW;YAC7B,OAAO,MAAM,CAAC,SAAS,KAAK,WAAW;YACvC,OAAO,MAAM,CAAC,SAAS,CAAC,SAAS,KAAK,WAAW;YACjD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC;IACzE,CAAC;;AAtCM,eAAK,GAAG,YAAY,CAAC,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { FlaggedError } from \"./flaggedError\";\n\n/**\n * Class extending Error with HTTP-specific error information like statusCode and statusMessage\n * @param title - The error title\n * @param statusCode - A numeric HTTP status code\n * @param statusMessage - A string message representing the response status message\n * @param method - The HTTP method used in the request\n * @param url - The URL that the request was sent to\n * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n */\nexport class HTTPError extends Error {\n\tconstructor(\n\t\tpublic title?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic statusMessage?: string,\n\t\tpublic method?: string,\n\t\tpublic url?: string,\n\t\tpublic flags = 0,\n\t) {\n\t\tsuper();\n\t\tObject.setPrototypeOf(this, HTTPError.prototype);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.message = this._generateMessage(title, statusCode, statusMessage, method, url);\n\t\tthis.stack = new Error(this.message).stack;\n\t}\n\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\tisQuiet(): boolean {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient(): boolean {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\tprivate _generateMessage(title, statusCode, statusMessage, method, url) {\n\t\tconst titleStr = title === undefined ? \"\" : String(title);\n\t\tconst statusCodeStr = statusCode === undefined ? \"\" : String(statusCode);\n\t\tconst statusMessageStr = statusMessage === undefined ? \"\" : String(statusMessage);\n\t\tconst methodStr = method === undefined ? \"\" : String(method);\n\t\tconst urlStr = url === undefined ? \"\" : String(url);\n\n\t\treturn (\n\t\t\t`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +\n\t\t\t`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`\n\t\t);\n\t}\n\n\t/**\n\t * Returns a string representing the HTTPError object\n\t * @returns a string representing the HTTPError object\n\t */\n\ttoString(): string {\n\t\tconst stack = this.stack === undefined ? \"\" : String(this.stack);\n\n\t\tconst isFirefox =\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain causes a test failure\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\ttypeof window.navigator !== \"undefined\" &&\n\t\t\ttypeof window.navigator.userAgent !== \"undefined\" &&\n\t\t\twindow.navigator.userAgent.toLowerCase().includes(\"firefox\");\n\n\t\treturn isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;\n\t}\n}\n"]}
@@ -11,6 +11,6 @@ export declare const GuidUtils: {
11
11
  generateGUID: (base64?: boolean) => string;
12
12
  isGUID: (in_guid: string) => boolean;
13
13
  combineGuids: (in_guid1: string, in_guid2: string, base64?: boolean) => string;
14
- hashCombine4xUint32: (in_array1: Uint32Array, in_array2: Uint32Array, io_result?: Uint32Array | undefined) => Uint32Array;
14
+ hashCombine4xUint32: (in_array1: Uint32Array, in_array2: Uint32Array, io_result?: Uint32Array) => Uint32Array;
15
15
  };
16
16
  //# sourceMappingURL=guidUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqUH,eAAO,MAAM,SAAS;mCAhLP,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,WACzC,OAAO,KACb,MAAM;8BA+BC,MAAM,WACP,WAAW,KACjB,WAAW;8BAsBmB,MAAM;8BASN,MAAM;;wCAaS,MAAM;sBAwB7B,MAAM;6BA2DU,MAAM,YAAY,MAAM,uBAAmB,MAAM;qCAhD9E,WAAW,aACX,WAAW,0CAEpB,WAAW;CAqEb,CAAC"}
1
+ {"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqUH,eAAO,MAAM,SAAS;mCAhLP,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,WACzC,OAAO,KACb,MAAM;8BA+BC,MAAM,WACP,WAAW,KACjB,WAAW;8BAsBmB,MAAM;8BASN,MAAM;;wCAaS,MAAM;sBAwB7B,MAAM;6BA2DU,MAAM,YAAY,MAAM,uBAAmB,MAAM;qCAhD9E,WAAW,aACX,WAAW,cACV,WAAW,KACrB,WAAW;CAqEb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/property-common",
3
- "version": "2.0.0-dev.6.4.0.192049",
3
+ "version": "2.0.0-dev.7.2.0.203917",
4
4
  "description": "common functions used in properties",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -45,11 +45,11 @@
45
45
  "traverse": "0.6.6"
46
46
  },
47
47
  "devDependencies": {
48
- "@fluidframework/build-common": "^2.0.0",
49
- "@fluidframework/build-tools": "^0.22.0",
50
- "@fluidframework/eslint-config-fluid": "^2.1.0",
51
- "@fluidframework/mocha-test-setup": "2.0.0-dev.6.4.0.192049",
52
- "@microsoft/api-extractor": "^7.34.4",
48
+ "@fluidframework/build-common": "^2.0.2",
49
+ "@fluidframework/build-tools": "0.26.0-203096",
50
+ "@fluidframework/eslint-config-fluid": "^3.0.0",
51
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.2.0.203917",
52
+ "@microsoft/api-extractor": "^7.37.0",
53
53
  "@types/chai": "^4.0.0",
54
54
  "@types/debug": "^4.1.5",
55
55
  "@types/lodash": "^4.14.118",
@@ -58,18 +58,17 @@
58
58
  "@types/semver": "^7.5.0",
59
59
  "c8": "^7.7.1",
60
60
  "chai": "^4.2.0",
61
- "copyfiles": "^2.4.1",
62
61
  "cross-env": "^7.0.3",
63
- "eslint": "~8.6.0",
62
+ "eslint": "~8.50.0",
64
63
  "mocha": "^10.2.0",
65
64
  "mocha-json-output-reporter": "^2.0.1",
66
65
  "mocha-multi-reporters": "^1.5.1",
67
66
  "moment": "^2.21.0",
68
67
  "nock": "^13.3.3",
69
- "prettier": "~2.6.2",
68
+ "prettier": "~3.0.3",
70
69
  "rimraf": "^4.4.0",
71
70
  "sinon": "^7.4.2",
72
- "typescript": "~4.5.5"
71
+ "typescript": "~5.1.6"
73
72
  },
74
73
  "typeValidation": {
75
74
  "disabled": true,
@@ -1,5 +1,17 @@
1
1
  # @fluid-internal/platform-dependent
2
2
 
3
+ ## 2.0.0-internal.7.1.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.0.0-internal.7.0.0
8
+
9
+ Dependency updates only.
10
+
11
+ ## 2.0.0-internal.6.4.0
12
+
13
+ Dependency updates only.
14
+
3
15
  ## 2.0.0-internal.6.3.0
4
16
 
5
17
  Dependency updates only.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-internal/platform-dependent",
3
- "version": "2.0.0-dev.6.4.0.192049",
3
+ "version": "2.0.0-dev.7.2.0.203917",
4
4
  "private": true,
5
5
  "description": "Helper package that separates code for browser and server.",
6
6
  "homepage": "https://fluidframework.com",
@@ -124,11 +124,7 @@ let impl:
124
124
  | typeof implementations.performance;
125
125
  if (typeof process !== "undefined" && typeof process.hrtime !== "undefined") {
126
126
  impl = implementations.node;
127
- } else if (
128
- typeof window !== "undefined" &&
129
- typeof window.performance !== "undefined" &&
130
- typeof window.performance.now !== "undefined"
131
- ) {
127
+ } else if (typeof window?.performance?.now !== "undefined") {
132
128
  impl = implementations.performance;
133
129
  } else {
134
130
  impl = implementations.date;
@@ -27,7 +27,10 @@ export class Collection<T> {
27
27
  * @param _type - optional parameter pointing to the constructor
28
28
  * of a type this Collection will host.
29
29
  */
30
- constructor(protected _name = "Untitled Collection", protected _type?: new () => any) {}
30
+ constructor(
31
+ protected _name = "Untitled Collection",
32
+ protected _type?: new () => any,
33
+ ) {}
31
34
 
32
35
  // Pass-thru binding handles
33
36
  onAdd(in_key, in_value) {}
@@ -41,7 +41,7 @@ class BaseDataArray {
41
41
 
42
42
  /**
43
43
  * Get the value at an index. If no index is passed, return zeroth item.
44
- * @param in_idx - The specific item in the data array.
44
+ * @param in_idx - The specific item in the data array.
45
45
  * @returns The value at that index.
46
46
  */
47
47
  getValue(in_idx = 0): any {
@@ -26,7 +26,10 @@ const { MSG } = constants;
26
26
  * @param high - Higher 32 bit
27
27
  */
28
28
  export class Integer64 {
29
- constructor(protected low = 0, protected high = 0) {}
29
+ constructor(
30
+ protected low = 0,
31
+ protected high = 0,
32
+ ) {}
30
33
 
31
34
  /**
32
35
  * @returns The higher 32 bit integer part
@@ -94,7 +97,7 @@ function _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): n
94
97
  let negative = false;
95
98
  let high = 0;
96
99
  let low = 0;
97
- if (string[0] === "-") {
100
+ if (string.startsWith("-")) {
98
101
  negative = true;
99
102
  position += 1;
100
103
  }
@@ -60,6 +60,7 @@ export class HTTPError extends Error {
60
60
  const stack = this.stack === undefined ? "" : String(this.stack);
61
61
 
62
62
  const isFirefox =
63
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain causes a test failure
63
64
  typeof window !== "undefined" &&
64
65
  typeof window.navigator !== "undefined" &&
65
66
  typeof window.navigator.userAgent !== "undefined" &&