@itwin/core-bentley 4.10.0-dev.8 → 5.0.0-dev.0

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 (73) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/lib/cjs/Assert.js +1 -2
  3. package/lib/cjs/Assert.js.map +1 -1
  4. package/lib/cjs/BeSQLite.d.ts.map +1 -1
  5. package/lib/cjs/BeSQLite.js +0 -2
  6. package/lib/cjs/BeSQLite.js.map +1 -1
  7. package/lib/cjs/ByteStream.js +2 -2
  8. package/lib/cjs/ByteStream.js.map +1 -1
  9. package/lib/cjs/ClassUtils.js +2 -3
  10. package/lib/cjs/ClassUtils.js.map +1 -1
  11. package/lib/cjs/Compare.js +9 -10
  12. package/lib/cjs/Compare.js.map +1 -1
  13. package/lib/cjs/CompressedId64Set.d.ts +1 -1
  14. package/lib/cjs/Disposable.d.ts.map +1 -1
  15. package/lib/cjs/Disposable.js +5 -6
  16. package/lib/cjs/Disposable.js.map +1 -1
  17. package/lib/cjs/Id.js +1 -1
  18. package/lib/cjs/Id.js.map +1 -1
  19. package/lib/cjs/JsonUtils.d.ts +1 -1
  20. package/lib/cjs/JsonUtils.js.map +1 -1
  21. package/lib/cjs/ObservableSet.js.map +1 -1
  22. package/lib/cjs/ProcessDetector.js +1 -1
  23. package/lib/cjs/ProcessDetector.js.map +1 -1
  24. package/lib/cjs/SortedArray.js +3 -3
  25. package/lib/cjs/SortedArray.js.map +1 -1
  26. package/lib/cjs/StringUtils.js +3 -4
  27. package/lib/cjs/StringUtils.js.map +1 -1
  28. package/lib/cjs/Time.d.ts.map +1 -1
  29. package/lib/cjs/Tracing.js +3 -3
  30. package/lib/cjs/Tracing.js.map +1 -1
  31. package/lib/cjs/UnexpectedErrors.d.ts +0 -1
  32. package/lib/cjs/UnexpectedErrors.d.ts.map +1 -1
  33. package/lib/cjs/UnexpectedErrors.js +1 -1
  34. package/lib/cjs/UnexpectedErrors.js.map +1 -1
  35. package/lib/cjs/UtilityTypes.d.ts +7 -3
  36. package/lib/cjs/UtilityTypes.d.ts.map +1 -1
  37. package/lib/cjs/UtilityTypes.js +3 -4
  38. package/lib/cjs/UtilityTypes.js.map +1 -1
  39. package/lib/cjs/internal/staticLoggerMetadata.d.ts +1 -1
  40. package/lib/cjs/internal/staticLoggerMetadata.js.map +1 -1
  41. package/lib/cjs/partitionArray.js +1 -2
  42. package/lib/cjs/partitionArray.js.map +1 -1
  43. package/lib/esm/BeSQLite.d.ts.map +1 -1
  44. package/lib/esm/BeSQLite.js +0 -2
  45. package/lib/esm/BeSQLite.js.map +1 -1
  46. package/lib/esm/ByteStream.js +2 -2
  47. package/lib/esm/ByteStream.js.map +1 -1
  48. package/lib/esm/CompressedId64Set.d.ts +1 -1
  49. package/lib/esm/Disposable.d.ts.map +1 -1
  50. package/lib/esm/Disposable.js +0 -1
  51. package/lib/esm/Disposable.js.map +1 -1
  52. package/lib/esm/Id.js +1 -1
  53. package/lib/esm/Id.js.map +1 -1
  54. package/lib/esm/JsonUtils.d.ts +1 -1
  55. package/lib/esm/JsonUtils.js.map +1 -1
  56. package/lib/esm/ObservableSet.js.map +1 -1
  57. package/lib/esm/ProcessDetector.js +1 -1
  58. package/lib/esm/ProcessDetector.js.map +1 -1
  59. package/lib/esm/StringUtils.js +1 -1
  60. package/lib/esm/StringUtils.js.map +1 -1
  61. package/lib/esm/Time.d.ts.map +1 -1
  62. package/lib/esm/Tracing.js +3 -3
  63. package/lib/esm/Tracing.js.map +1 -1
  64. package/lib/esm/UnexpectedErrors.d.ts +0 -1
  65. package/lib/esm/UnexpectedErrors.d.ts.map +1 -1
  66. package/lib/esm/UnexpectedErrors.js +1 -1
  67. package/lib/esm/UnexpectedErrors.js.map +1 -1
  68. package/lib/esm/UtilityTypes.d.ts +7 -3
  69. package/lib/esm/UtilityTypes.d.ts.map +1 -1
  70. package/lib/esm/UtilityTypes.js.map +1 -1
  71. package/lib/esm/internal/staticLoggerMetadata.d.ts +1 -1
  72. package/lib/esm/internal/staticLoggerMetadata.js.map +1 -1
  73. package/package.json +10 -15
package/CHANGELOG.md CHANGED
@@ -1,6 +1,28 @@
1
1
  # Change Log - @itwin/core-bentley
2
2
 
3
- This log was last generated on Wed, 25 Sep 2024 20:12:30 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 22 Oct 2024 20:03:09 GMT and should not be manually modified.
4
+
5
+ ## 4.9.5
6
+ Tue, 22 Oct 2024 20:01:40 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.9.4
11
+ Wed, 09 Oct 2024 20:22:04 GMT
12
+
13
+ ### Updates
14
+
15
+ - Add MaybePromise utility type.
16
+
17
+ ## 4.9.3
18
+ Thu, 03 Oct 2024 19:15:45 GMT
19
+
20
+ _Version update only_
21
+
22
+ ## 4.9.2
23
+ Wed, 02 Oct 2024 15:14:43 GMT
24
+
25
+ _Version update only_
4
26
 
5
27
  ## 4.9.1
6
28
  Wed, 25 Sep 2024 20:10:58 GMT
package/lib/cjs/Assert.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * @module Utils
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.assert = void 0;
10
+ exports.assert = assert;
11
11
  const assertionsEnabled = process.env.NODE_ENV === "development";
12
12
  /** Asserts that a condition is `true` and - when enabled - throws an error if it is not.
13
13
  * Assertions are enabled only if the build configuration defines `process.env.NODE_ENV` as `development` at build time.
@@ -42,5 +42,4 @@ function assert(condition, message) {
42
42
  message = message();
43
43
  throw new Error(`Assert: ${message}`);
44
44
  }
45
- exports.assert = assert;
46
45
  //# sourceMappingURL=Assert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Assert.js","sourceRoot":"","sources":["../../src/Assert.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,MAAM,CAAC,SAAoC,EAAE,OAAiC;IAC5F,IAAI,CAAC,iBAAiB;QACpB,OAAO;IAET,IAAI,SAAS,KAAK,OAAO,SAAS;QAChC,SAAS,GAAG,SAAS,EAAE,CAAC;IAE1B,IAAI,SAAS;QACX,OAAO;IAET,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAAC;IACxC,IAAI,QAAQ,KAAK,OAAO,OAAO;QAC7B,OAAO,GAAG,OAAO,EAAE,CAAC;IAEtB,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC;AAfD,wBAeC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\nconst assertionsEnabled = process.env.NODE_ENV === \"development\";\r\n\r\n/** Asserts that a condition is `true` and - when enabled - throws an error if it is not.\r\n * Assertions are enabled only if the build configuration defines `process.env.NODE_ENV` as `development` at build time.\r\n *\r\n * Assertions exist solely to assist programmers during development, in the following ways:\r\n * 1 They allow the programmer to declare conditions that they believe cannot possibly occur. If such conditions occur, they indicate\r\n * a serious flaw in the programmer's logic.\r\n * 2 They allow the programmer to assure the TypeScript compiler of the truth of some condition that the compiler cannot itself infer.\r\n * 3 They allow the author of an API to indicate to consumers of the API a serious misuse that should be corrected during development.\r\n *\r\n * Assertions should **never** be used to test for conditions - however unlikely - that could be expected to occur at run-time,\r\n * such as failing to write to a file or load a resource over the network. If the condition asserted ever fails in a production environment,\r\n * the programmer has made a serious mistake.\r\n *\r\n * Note that even when assertions are disabled, calls to `assert` remain in the code and their arguments will be evaluated at run-time.\r\n * Therefore, if your condition or message requires computation, prefer to pass it as a function to prevent it from being evaluated when assertions are disabled.\r\n *\r\n * @param condition The condition that is asserted to be `true`. If the condition is more complex than a simple `boolean` variable, pass it as a function to prevent it from being evaluated when assertions are disabled.\r\n * @param message An optional description of the condition being asserted, to be included in the exception if `condition` is `false`. If the message must be computed, pass it as a function to prevent it from being evaluated when assertions are disabled. Defaults to \"Programmer Error\".\r\n * @throws Error containing the specified `message` if `condition` is `false`.\r\n * @public\r\n */\r\nexport function assert(condition: boolean | (() => boolean), message?: string | (() => string)): asserts condition {\r\n if (!assertionsEnabled)\r\n return;\r\n\r\n if (\"boolean\" !== typeof condition)\r\n condition = condition();\r\n\r\n if (condition)\r\n return;\r\n\r\n message = message ?? \"Programmer Error\";\r\n if (\"string\" !== typeof message)\r\n message = message();\r\n\r\n throw new Error(`Assert: ${message}`);\r\n}\r\n"]}
1
+ {"version":3,"file":"Assert.js","sourceRoot":"","sources":["../../src/Assert.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAyBH,wBAeC;AAtCD,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,MAAM,CAAC,SAAoC,EAAE,OAAiC;IAC5F,IAAI,CAAC,iBAAiB;QACpB,OAAO;IAET,IAAI,SAAS,KAAK,OAAO,SAAS;QAChC,SAAS,GAAG,SAAS,EAAE,CAAC;IAE1B,IAAI,SAAS;QACX,OAAO;IAET,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAAC;IACxC,IAAI,QAAQ,KAAK,OAAO,OAAO;QAC7B,OAAO,GAAG,OAAO,EAAE,CAAC;IAEtB,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\nconst assertionsEnabled = process.env.NODE_ENV === \"development\";\r\n\r\n/** Asserts that a condition is `true` and - when enabled - throws an error if it is not.\r\n * Assertions are enabled only if the build configuration defines `process.env.NODE_ENV` as `development` at build time.\r\n *\r\n * Assertions exist solely to assist programmers during development, in the following ways:\r\n * 1 They allow the programmer to declare conditions that they believe cannot possibly occur. If such conditions occur, they indicate\r\n * a serious flaw in the programmer's logic.\r\n * 2 They allow the programmer to assure the TypeScript compiler of the truth of some condition that the compiler cannot itself infer.\r\n * 3 They allow the author of an API to indicate to consumers of the API a serious misuse that should be corrected during development.\r\n *\r\n * Assertions should **never** be used to test for conditions - however unlikely - that could be expected to occur at run-time,\r\n * such as failing to write to a file or load a resource over the network. If the condition asserted ever fails in a production environment,\r\n * the programmer has made a serious mistake.\r\n *\r\n * Note that even when assertions are disabled, calls to `assert` remain in the code and their arguments will be evaluated at run-time.\r\n * Therefore, if your condition or message requires computation, prefer to pass it as a function to prevent it from being evaluated when assertions are disabled.\r\n *\r\n * @param condition The condition that is asserted to be `true`. If the condition is more complex than a simple `boolean` variable, pass it as a function to prevent it from being evaluated when assertions are disabled.\r\n * @param message An optional description of the condition being asserted, to be included in the exception if `condition` is `false`. If the message must be computed, pass it as a function to prevent it from being evaluated when assertions are disabled. Defaults to \"Programmer Error\".\r\n * @throws Error containing the specified `message` if `condition` is `false`.\r\n * @public\r\n */\r\nexport function assert(condition: boolean | (() => boolean), message?: string | (() => string)): asserts condition {\r\n if (!assertionsEnabled)\r\n return;\r\n\r\n if (\"boolean\" !== typeof condition)\r\n condition = condition();\r\n\r\n if (condition)\r\n return;\r\n\r\n message = message ?? \"Programmer Error\";\r\n if (\"string\" !== typeof message)\r\n message = message();\r\n\r\n throw new Error(`Assert: ${message}`);\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BeSQLite.d.ts","sourceRoot":"","sources":["../../src/BeSQLite.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,oBAAY,QAAQ;IAClB,QAAQ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C,4BAA4B,WAAgC;IAC5D,sGAAsG;IACtG,2BAA2B,WAAgC;IAC3D,qCAAqC;IACrC,4BAA4B,YAAgC;IAC5D,+CAA+C;IAC/C,qCAAqC,YAAgC;IACrE,yCAAyC;IACzC,oCAAoC,YAAgC;IACpE,+EAA+E;IAC/E,yCAAyC,YAAgC;IACzE,mEAAmE;IACnE,6BAA6B,YAAiC;IAC9D,qGAAqG;IACrG,yCAAyC,YAAiC;IAC1E,mEAAmE;IACnE,6BAA6B,YAAiC;IAC9D,gDAAgD;IAChD,gCAAgC,YAAiC;IACjE,6DAA6D;IAC7D,uCAAuC,YAAiC;IACxE,4DAA4D;IAC5D,qCAAqC,YAA+B;IACpE,+FAA+F;IAC/F,4BAA4B,YAA+B;IAC3D,yFAAyF;IACzF,4BAA4B,YAA+B;IAC3D,4DAA4D;IAC5D,gCAAgC,YAA+B;IAC/D,mDAAmD;IACnD,mCAAmC,YAA+B;IAClE,qDAAqD;IACrD,kCAAkC,YAA+B;IACjE,qCAAqC;IACrC,2CAA2C,YAA+B;IAC1E,qEAAqE;IACrE,wCAAwC,YAA+B;IACvE,2CAA2C;IAC3C,qCAAqC,YAAiC;IAEtE,4BAA4B,MAAgC;IAC5D,uBAAuB,MAA8B;IACrD,4BAA4B,MAAkC;IAC9D,wBAAwB,MAAkC;IAC1D,2BAA2B,MAAkC;IAC7D,sBAAsB,MAAiC;IACvD,2BAA2B,MAAkC;IAC7D,2BAA2B,MAAkC;IAC7D,2BAA2B,MAAkC;IAC7D,wBAAwB,MAA+B;IACvD,0BAA0B,MAAyC;IACnE,+BAA+B,MAAyC;IACxE,+BAA+B,MAAyC;IACxE,6BAA6B,OAAyC;IACtE,4BAA4B,OAAyC;IACrE,+BAA+B,OAAyC;IACxE,4BAA4B,OAAyC;IACrE,2BAA2B,OAAyC;IACpE,yBAAyB,OAAyC;CACnE"}
@@ -31,7 +31,6 @@ var DbOpcode;
31
31
  /** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations.
32
32
  * @public
33
33
  */
34
- /* eslint-disable @typescript-eslint/naming-convention */
35
34
  // Disabling for the rest of the file since eslint does not correctly parse the entire enum, only parts of it
36
35
  var DbResult;
37
36
  (function (DbResult) {
@@ -182,5 +181,4 @@ var DbResult;
182
181
  DbResult[DbResult["BE_SQLITE_CONSTRAINT_UNIQUE"] = 2067] = "BE_SQLITE_CONSTRAINT_UNIQUE";
183
182
  DbResult[DbResult["BE_SQLITE_CONSTRAINT_VTAB"] = 2323] = "BE_SQLITE_CONSTRAINT_VTAB";
184
183
  })(DbResult || (exports.DbResult = DbResult = {}));
185
- /* eslint-enable @typescript-eslint/naming-convention */
186
184
  //# sourceMappingURL=BeSQLite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BeSQLite.js","sourceRoot":"","sources":["../../src/BeSQLite.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+CAAqB,CAAA;IACrB,iDAAsB,CAAA;AACxB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;GAEG;AACH,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,yBAAyB;IACzB,2CAAU,CAAA;IACV,8BAA8B;IAC9B,4CAAW,CAAA;IACX,oDAAoD;IACpD,4CAAW,CAAA;AACb,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;AAED;;GAEG;AACH,yDAAyD;AACzD,8GAA8G;AAC9G,IAAY,QAsJX;AAtJD,WAAY,QAAQ;IAClB,cAAc;IACd,uDAAgB,CAAA;IAChB,oCAAoC;IACpC,6DAAmB,CAAA;IACnB,2BAA2B;IAC3B,mEAAsB,CAAA;IACtB,+BAA+B;IAC/B,2DAAkB,CAAA;IAClB,0CAA0C;IAC1C,6DAAmB,CAAA;IACnB,kCAAkC;IAClC,2DAAkB,CAAA;IAClB,wCAAwC;IACxC,+DAAoB,CAAA;IACpB,wBAAwB;IACxB,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CAAC,EAtJW,QAAQ,wBAAR,QAAQ,QAsJnB;AACD,wDAAwD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module BeSQLite\r\n */\r\n\r\n/** Whether to open a database readonly or writeable.\r\n * @public\r\n */\r\nexport enum OpenMode {\r\n Readonly = 0x00000001,\r\n ReadWrite = 0x00000002,\r\n}\r\n\r\n/** Values, stored in changesets, that indicate what operation was performed on the database.\r\n * @public\r\n */\r\nexport enum DbOpcode {\r\n /** A row was deleted. */\r\n Delete = 9,\r\n /** A new row was inserted. */\r\n Insert = 18,\r\n /** Some columns of an existing row were updated. */\r\n Update = 23,\r\n}\r\n\r\n/** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations.\r\n * @public\r\n */\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n// Disabling for the rest of the file since eslint does not correctly parse the entire enum, only parts of it\r\nexport enum DbResult {\r\n /** Success */\r\n BE_SQLITE_OK = 0,\r\n /** SQL error or missing database */\r\n BE_SQLITE_ERROR = 1,\r\n /** Internal logic error */\r\n BE_SQLITE_INTERNAL = 2,\r\n /** Access permission denied */\r\n BE_SQLITE_PERM = 3,\r\n /** Callback routine requested an abort */\r\n BE_SQLITE_ABORT = 4,\r\n /** The database file is locked */\r\n BE_SQLITE_BUSY = 5,\r\n /** A table in the database is locked */\r\n BE_SQLITE_LOCKED = 6,\r\n /** A malloc() failed */\r\n BE_SQLITE_NOMEM = 7,\r\n /** Attempt to write a readonly database */\r\n BE_SQLITE_READONLY = 8,\r\n /** Operation terminated by interrupt */\r\n BE_SQLITE_INTERRUPT = 9,\r\n /** Some kind of disk I/O error occurred */\r\n BE_SQLITE_IOERR = 10,\r\n /** The database disk image is malformed */\r\n BE_SQLITE_CORRUPT = 11,\r\n /** NOT USED. Table or record not found */\r\n BE_SQLITE_NOTFOUND = 12,\r\n /** Insertion failed because database is full or write operation failed because disk is full */\r\n BE_SQLITE_FULL = 13,\r\n /** Unable to open the database file */\r\n BE_SQLITE_CANTOPEN = 14,\r\n /** Database lock protocol error */\r\n BE_SQLITE_PROTOCOL = 15,\r\n /** Database is empty */\r\n BE_SQLITE_EMPTY = 16,\r\n /** The database schema changed */\r\n BE_SQLITE_SCHEMA = 17,\r\n /** String or BLOB exceeds size limit */\r\n BE_SQLITE_TOOBIG = 18,\r\n /** Abort due to constraint violation. See extended error values. */\r\n BE_SQLITE_CONSTRAINT_BASE = 19,\r\n /** Data type mismatch */\r\n BE_SQLITE_MISMATCH = 20,\r\n /** Library used incorrectly */\r\n BE_SQLITE_MISUSE = 21,\r\n /** Uses OS features not supported on host */\r\n BE_SQLITE_NOLFS = 22,\r\n /** Authorization denied */\r\n BE_SQLITE_AUTH = 23,\r\n /** Auxiliary database format error */\r\n BE_SQLITE_FORMAT = 24,\r\n /** 2nd parameter to Bind out of range */\r\n BE_SQLITE_RANGE = 25,\r\n /** File opened that is not a database file */\r\n BE_SQLITE_NOTADB = 26,\r\n /** Step() has another row ready */\r\n BE_SQLITE_ROW = 100,\r\n /** Step() has finished executing */\r\n BE_SQLITE_DONE = 101,\r\n\r\n BE_SQLITE_IOERR_READ = (BE_SQLITE_IOERR | (1 << 8)),\r\n BE_SQLITE_IOERR_SHORT_READ = (BE_SQLITE_IOERR | (2 << 8)),\r\n BE_SQLITE_IOERR_WRITE = (BE_SQLITE_IOERR | (3 << 8)),\r\n BE_SQLITE_IOERR_FSYNC = (BE_SQLITE_IOERR | (4 << 8)),\r\n BE_SQLITE_IOERR_DIR_FSYNC = (BE_SQLITE_IOERR | (5 << 8)),\r\n BE_SQLITE_IOERR_TRUNCATE = (BE_SQLITE_IOERR | (6 << 8)),\r\n BE_SQLITE_IOERR_FSTAT = (BE_SQLITE_IOERR | (7 << 8)),\r\n BE_SQLITE_IOERR_UNLOCK = (BE_SQLITE_IOERR | (8 << 8)),\r\n BE_SQLITE_IOERR_RDLOCK = (BE_SQLITE_IOERR | (9 << 8)),\r\n BE_SQLITE_IOERR_DELETE = (BE_SQLITE_IOERR | (10 << 8)),\r\n BE_SQLITE_IOERR_BLOCKED = (BE_SQLITE_IOERR | (11 << 8)),\r\n BE_SQLITE_IOERR_NOMEM = (BE_SQLITE_IOERR | (12 << 8)),\r\n BE_SQLITE_IOERR_ACCESS = (BE_SQLITE_IOERR | (13 << 8)),\r\n BE_SQLITE_IOERR_CHECKRESERVEDLOCK = (BE_SQLITE_IOERR | (14 << 8)),\r\n BE_SQLITE_IOERR_LOCK = (BE_SQLITE_IOERR | (15 << 8)),\r\n BE_SQLITE_IOERR_CLOSE = (BE_SQLITE_IOERR | (16 << 8)),\r\n BE_SQLITE_IOERR_DIR_CLOSE = (BE_SQLITE_IOERR | (17 << 8)),\r\n BE_SQLITE_IOERR_SHMOPEN = (BE_SQLITE_IOERR | (18 << 8)),\r\n BE_SQLITE_IOERR_SHMSIZE = (BE_SQLITE_IOERR | (19 << 8)),\r\n BE_SQLITE_IOERR_SHMLOCK = (BE_SQLITE_IOERR | (20 << 8)),\r\n BE_SQLITE_IOERR_SHMMAP = (BE_SQLITE_IOERR | (21 << 8)),\r\n BE_SQLITE_IOERR_SEEK = (BE_SQLITE_IOERR | (22 << 8)),\r\n BE_SQLITE_IOERR_DELETE_NOENT = (BE_SQLITE_IOERR | (23 << 8)),\r\n\r\n /** attempt to create a new file when a file by that name already exists */\r\n BE_SQLITE_ERROR_FileExists = (BE_SQLITE_IOERR | (1 << 24)),\r\n /** attempt to open a BeSQLite::Db that is already in use somewhere. */\r\n BE_SQLITE_ERROR_AlreadyOpen = (BE_SQLITE_IOERR | (2 << 24)),\r\n /** attempt to open a BeSQLite::Db that doesn't have a property table. */\r\n BE_SQLITE_ERROR_NoPropertyTable = (BE_SQLITE_IOERR | (3 << 24)),\r\n /** the database name is not a file. */\r\n BE_SQLITE_ERROR_FileNotFound = (BE_SQLITE_IOERR | (4 << 24)),\r\n /** there is no transaction active and the database was opened with AllowImplicitTransactions=false */\r\n BE_SQLITE_ERROR_NoTxnActive = (BE_SQLITE_IOERR | (5 << 24)),\r\n /** wrong BeSQLite profile version */\r\n BE_SQLITE_ERROR_BadDbProfile = (BE_SQLITE_IOERR | (6 << 24)),\r\n /** Profile of file could not be determined. */\r\n BE_SQLITE_ERROR_InvalidProfileVersion = (BE_SQLITE_IOERR | (7 << 24)),\r\n /** Upgrade of profile of file failed. */\r\n BE_SQLITE_ERROR_ProfileUpgradeFailed = (BE_SQLITE_IOERR | (8 << 24)),\r\n /** Profile of file is too old. Therefore file can only be opened read-only. */\r\n BE_SQLITE_ERROR_ProfileTooOldForReadWrite = (BE_SQLITE_IOERR | (9 << 24)),\r\n /** Profile of file is too old. Therefore file cannot be opened. */\r\n BE_SQLITE_ERROR_ProfileTooOld = (BE_SQLITE_IOERR | (10 << 24)),\r\n /** Profile of file is too new for read-write access. Therefore file can only be opened read-only. */\r\n BE_SQLITE_ERROR_ProfileTooNewForReadWrite = (BE_SQLITE_IOERR | (11 << 24)),\r\n /** Profile of file is too new. Therefore file cannot be opened. */\r\n BE_SQLITE_ERROR_ProfileTooNew = (BE_SQLITE_IOERR | (12 << 24)),\r\n /** attempt to commit with active changetrack */\r\n BE_SQLITE_ERROR_ChangeTrackError = (BE_SQLITE_IOERR | (13 << 24)),\r\n /** invalid version of the revision file is being imported */\r\n BE_SQLITE_ERROR_InvalidChangeSetVersion = (BE_SQLITE_IOERR | (14 << 24)),\r\n /** The schemas found in the database need to be upgraded */\r\n BE_SQLITE_ERROR_SchemaUpgradeRequired = (BE_SQLITE_IOERR | 15 << 24),\r\n /** The schemas found in the database are too new, and the application needs to be upgraded. */\r\n BE_SQLITE_ERROR_SchemaTooNew = (BE_SQLITE_IOERR | 16 << 24),\r\n /** The schemas found in the database are too old, and the DgnDb needs to be upgraded. */\r\n BE_SQLITE_ERROR_SchemaTooOld = (BE_SQLITE_IOERR | 17 << 24),\r\n /** Error acquiring a lock on the schemas before upgrade. */\r\n BE_SQLITE_ERROR_SchemaLockFailed = (BE_SQLITE_IOERR | 18 << 24),\r\n /** Error upgrading the schemas in the database. */\r\n BE_SQLITE_ERROR_SchemaUpgradeFailed = (BE_SQLITE_IOERR | 19 << 24),\r\n /** Error importing the schemas into the database. */\r\n BE_SQLITE_ERROR_SchemaImportFailed = (BE_SQLITE_IOERR | 20 << 24),\r\n /** Error acquiring locks or codes */\r\n BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes = (BE_SQLITE_IOERR | 21 << 24),\r\n /** Recommended that the schemas found in the database be upgraded */\r\n BE_SQLITE_ERROR_SchemaUpgradeRecommended = (BE_SQLITE_IOERR | 22 << 24),\r\n /** schema update require data transform */\r\n BE_SQLITE_ERROR_DataTransformRequired = (BE_SQLITE_IOERR | (23 << 24)),\r\n\r\n BE_SQLITE_LOCKED_SHAREDCACHE = (BE_SQLITE_LOCKED | (1 << 8)),\r\n BE_SQLITE_BUSY_RECOVERY = (BE_SQLITE_BUSY | (1 << 8)),\r\n BE_SQLITE_CANTOPEN_NOTEMPDIR = (BE_SQLITE_CANTOPEN | (1 << 8)),\r\n BE_SQLITE_CANTOPEN_ISDIR = (BE_SQLITE_CANTOPEN | (2 << 8)),\r\n BE_SQLITE_CANTOPEN_FULLPATH = (BE_SQLITE_CANTOPEN | (3 << 8)),\r\n BE_SQLITE_CORRUPT_VTAB = (BE_SQLITE_CORRUPT | (1 << 8)),\r\n BE_SQLITE_READONLY_RECOVERY = (BE_SQLITE_READONLY | (1 << 8)),\r\n BE_SQLITE_READONLY_CANTLOCK = (BE_SQLITE_READONLY | (2 << 8)),\r\n BE_SQLITE_READONLY_ROLLBACK = (BE_SQLITE_READONLY | (3 << 8)),\r\n BE_SQLITE_ABORT_ROLLBACK = (BE_SQLITE_ABORT | (2 << 8)),\r\n BE_SQLITE_CONSTRAINT_CHECK = (BE_SQLITE_CONSTRAINT_BASE | (1 << 8)),\r\n BE_SQLITE_CONSTRAINT_COMMITHOOK = (BE_SQLITE_CONSTRAINT_BASE | (2 << 8)),\r\n BE_SQLITE_CONSTRAINT_FOREIGNKEY = (BE_SQLITE_CONSTRAINT_BASE | (3 << 8)),\r\n BE_SQLITE_CONSTRAINT_FUNCTION = (BE_SQLITE_CONSTRAINT_BASE | (4 << 8)),\r\n BE_SQLITE_CONSTRAINT_NOTNULL = (BE_SQLITE_CONSTRAINT_BASE | (5 << 8)),\r\n BE_SQLITE_CONSTRAINT_PRIMARYKEY = (BE_SQLITE_CONSTRAINT_BASE | (6 << 8)),\r\n BE_SQLITE_CONSTRAINT_TRIGGER = (BE_SQLITE_CONSTRAINT_BASE | (7 << 8)),\r\n BE_SQLITE_CONSTRAINT_UNIQUE = (BE_SQLITE_CONSTRAINT_BASE | (8 << 8)),\r\n BE_SQLITE_CONSTRAINT_VTAB = (BE_SQLITE_CONSTRAINT_BASE | (9 << 8)),\r\n}\r\n/* eslint-enable @typescript-eslint/naming-convention */\r\n"]}
1
+ {"version":3,"file":"BeSQLite.js","sourceRoot":"","sources":["../../src/BeSQLite.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+CAAqB,CAAA;IACrB,iDAAsB,CAAA;AACxB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED;;GAEG;AACH,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,yBAAyB;IACzB,2CAAU,CAAA;IACV,8BAA8B;IAC9B,4CAAW,CAAA;IACX,oDAAoD;IACpD,4CAAW,CAAA;AACb,CAAC,EAPW,QAAQ,wBAAR,QAAQ,QAOnB;AAED;;GAEG;AACH,8GAA8G;AAC9G,IAAY,QAsJX;AAtJD,WAAY,QAAQ;IAClB,cAAc;IACd,uDAAgB,CAAA;IAChB,oCAAoC;IACpC,6DAAmB,CAAA;IACnB,2BAA2B;IAC3B,mEAAsB,CAAA;IACtB,+BA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AA;IACxE,+FAAwE,CAAA;IACxE,4FAAsE,CAAA;IACtE,0FAAqE,CAAA;IACrE,gGAAwE,CAAA;IACxE,0FAAqE,CAAA;IACrE,wFAAoE,CAAA;IACpE,oFAAkE,CAAA;AACpE,CAAC,EAtJW,QAAQ,wBAAR,QAAQ,QAsJnB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module BeSQLite\r\n */\r\n\r\n/** Whether to open a database readonly or writeable.\r\n * @public\r\n */\r\nexport enum OpenMode {\r\n Readonly = 0x00000001,\r\n ReadWrite = 0x00000002,\r\n}\r\n\r\n/** Values, stored in changesets, that indicate what operation was performed on the database.\r\n * @public\r\n */\r\nexport enum DbOpcode {\r\n /** A row was deleted. */\r\n Delete = 9,\r\n /** A new row was inserted. */\r\n Insert = 18,\r\n /** Some columns of an existing row were updated. */\r\n Update = 23,\r\n}\r\n\r\n/** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations.\r\n * @public\r\n */\r\n// Disabling for the rest of the file since eslint does not correctly parse the entire enum, only parts of it\r\nexport enum DbResult {\r\n /** Success */\r\n BE_SQLITE_OK = 0,\r\n /** SQL error or missing database */\r\n BE_SQLITE_ERROR = 1,\r\n /** Internal logic error */\r\n BE_SQLITE_INTERNAL = 2,\r\n /** Access permission denied */\r\n BE_SQLITE_PERM = 3,\r\n /** Callback routine requested an abort */\r\n BE_SQLITE_ABORT = 4,\r\n /** The database file is locked */\r\n BE_SQLITE_BUSY = 5,\r\n /** A table in the database is locked */\r\n BE_SQLITE_LOCKED = 6,\r\n /** A malloc() failed */\r\n BE_SQLITE_NOMEM = 7,\r\n /** Attempt to write a readonly database */\r\n BE_SQLITE_READONLY = 8,\r\n /** Operation terminated by interrupt */\r\n BE_SQLITE_INTERRUPT = 9,\r\n /** Some kind of disk I/O error occurred */\r\n BE_SQLITE_IOERR = 10,\r\n /** The database disk image is malformed */\r\n BE_SQLITE_CORRUPT = 11,\r\n /** NOT USED. Table or record not found */\r\n BE_SQLITE_NOTFOUND = 12,\r\n /** Insertion failed because database is full or write operation failed because disk is full */\r\n BE_SQLITE_FULL = 13,\r\n /** Unable to open the database file */\r\n BE_SQLITE_CANTOPEN = 14,\r\n /** Database lock protocol error */\r\n BE_SQLITE_PROTOCOL = 15,\r\n /** Database is empty */\r\n BE_SQLITE_EMPTY = 16,\r\n /** The database schema changed */\r\n BE_SQLITE_SCHEMA = 17,\r\n /** String or BLOB exceeds size limit */\r\n BE_SQLITE_TOOBIG = 18,\r\n /** Abort due to constraint violation. See extended error values. */\r\n BE_SQLITE_CONSTRAINT_BASE = 19,\r\n /** Data type mismatch */\r\n BE_SQLITE_MISMATCH = 20,\r\n /** Library used incorrectly */\r\n BE_SQLITE_MISUSE = 21,\r\n /** Uses OS features not supported on host */\r\n BE_SQLITE_NOLFS = 22,\r\n /** Authorization denied */\r\n BE_SQLITE_AUTH = 23,\r\n /** Auxiliary database format error */\r\n BE_SQLITE_FORMAT = 24,\r\n /** 2nd parameter to Bind out of range */\r\n BE_SQLITE_RANGE = 25,\r\n /** File opened that is not a database file */\r\n BE_SQLITE_NOTADB = 26,\r\n /** Step() has another row ready */\r\n BE_SQLITE_ROW = 100,\r\n /** Step() has finished executing */\r\n BE_SQLITE_DONE = 101,\r\n\r\n BE_SQLITE_IOERR_READ = (BE_SQLITE_IOERR | (1 << 8)),\r\n BE_SQLITE_IOERR_SHORT_READ = (BE_SQLITE_IOERR | (2 << 8)),\r\n BE_SQLITE_IOERR_WRITE = (BE_SQLITE_IOERR | (3 << 8)),\r\n BE_SQLITE_IOERR_FSYNC = (BE_SQLITE_IOERR | (4 << 8)),\r\n BE_SQLITE_IOERR_DIR_FSYNC = (BE_SQLITE_IOERR | (5 << 8)),\r\n BE_SQLITE_IOERR_TRUNCATE = (BE_SQLITE_IOERR | (6 << 8)),\r\n BE_SQLITE_IOERR_FSTAT = (BE_SQLITE_IOERR | (7 << 8)),\r\n BE_SQLITE_IOERR_UNLOCK = (BE_SQLITE_IOERR | (8 << 8)),\r\n BE_SQLITE_IOERR_RDLOCK = (BE_SQLITE_IOERR | (9 << 8)),\r\n BE_SQLITE_IOERR_DELETE = (BE_SQLITE_IOERR | (10 << 8)),\r\n BE_SQLITE_IOERR_BLOCKED = (BE_SQLITE_IOERR | (11 << 8)),\r\n BE_SQLITE_IOERR_NOMEM = (BE_SQLITE_IOERR | (12 << 8)),\r\n BE_SQLITE_IOERR_ACCESS = (BE_SQLITE_IOERR | (13 << 8)),\r\n BE_SQLITE_IOERR_CHECKRESERVEDLOCK = (BE_SQLITE_IOERR | (14 << 8)),\r\n BE_SQLITE_IOERR_LOCK = (BE_SQLITE_IOERR | (15 << 8)),\r\n BE_SQLITE_IOERR_CLOSE = (BE_SQLITE_IOERR | (16 << 8)),\r\n BE_SQLITE_IOERR_DIR_CLOSE = (BE_SQLITE_IOERR | (17 << 8)),\r\n BE_SQLITE_IOERR_SHMOPEN = (BE_SQLITE_IOERR | (18 << 8)),\r\n BE_SQLITE_IOERR_SHMSIZE = (BE_SQLITE_IOERR | (19 << 8)),\r\n BE_SQLITE_IOERR_SHMLOCK = (BE_SQLITE_IOERR | (20 << 8)),\r\n BE_SQLITE_IOERR_SHMMAP = (BE_SQLITE_IOERR | (21 << 8)),\r\n BE_SQLITE_IOERR_SEEK = (BE_SQLITE_IOERR | (22 << 8)),\r\n BE_SQLITE_IOERR_DELETE_NOENT = (BE_SQLITE_IOERR | (23 << 8)),\r\n\r\n /** attempt to create a new file when a file by that name already exists */\r\n BE_SQLITE_ERROR_FileExists = (BE_SQLITE_IOERR | (1 << 24)),\r\n /** attempt to open a BeSQLite::Db that is already in use somewhere. */\r\n BE_SQLITE_ERROR_AlreadyOpen = (BE_SQLITE_IOERR | (2 << 24)),\r\n /** attempt to open a BeSQLite::Db that doesn't have a property table. */\r\n BE_SQLITE_ERROR_NoPropertyTable = (BE_SQLITE_IOERR | (3 << 24)),\r\n /** the database name is not a file. */\r\n BE_SQLITE_ERROR_FileNotFound = (BE_SQLITE_IOERR | (4 << 24)),\r\n /** there is no transaction active and the database was opened with AllowImplicitTransactions=false */\r\n BE_SQLITE_ERROR_NoTxnActive = (BE_SQLITE_IOERR | (5 << 24)),\r\n /** wrong BeSQLite profile version */\r\n BE_SQLITE_ERROR_BadDbProfile = (BE_SQLITE_IOERR | (6 << 24)),\r\n /** Profile of file could not be determined. */\r\n BE_SQLITE_ERROR_InvalidProfileVersion = (BE_SQLITE_IOERR | (7 << 24)),\r\n /** Upgrade of profile of file failed. */\r\n BE_SQLITE_ERROR_ProfileUpgradeFailed = (BE_SQLITE_IOERR | (8 << 24)),\r\n /** Profile of file is too old. Therefore file can only be opened read-only. */\r\n BE_SQLITE_ERROR_ProfileTooOldForReadWrite = (BE_SQLITE_IOERR | (9 << 24)),\r\n /** Profile of file is too old. Therefore file cannot be opened. */\r\n BE_SQLITE_ERROR_ProfileTooOld = (BE_SQLITE_IOERR | (10 << 24)),\r\n /** Profile of file is too new for read-write access. Therefore file can only be opened read-only. */\r\n BE_SQLITE_ERROR_ProfileTooNewForReadWrite = (BE_SQLITE_IOERR | (11 << 24)),\r\n /** Profile of file is too new. Therefore file cannot be opened. */\r\n BE_SQLITE_ERROR_ProfileTooNew = (BE_SQLITE_IOERR | (12 << 24)),\r\n /** attempt to commit with active changetrack */\r\n BE_SQLITE_ERROR_ChangeTrackError = (BE_SQLITE_IOERR | (13 << 24)),\r\n /** invalid version of the revision file is being imported */\r\n BE_SQLITE_ERROR_InvalidChangeSetVersion = (BE_SQLITE_IOERR | (14 << 24)),\r\n /** The schemas found in the database need to be upgraded */\r\n BE_SQLITE_ERROR_SchemaUpgradeRequired = (BE_SQLITE_IOERR | 15 << 24),\r\n /** The schemas found in the database are too new, and the application needs to be upgraded. */\r\n BE_SQLITE_ERROR_SchemaTooNew = (BE_SQLITE_IOERR | 16 << 24),\r\n /** The schemas found in the database are too old, and the DgnDb needs to be upgraded. */\r\n BE_SQLITE_ERROR_SchemaTooOld = (BE_SQLITE_IOERR | 17 << 24),\r\n /** Error acquiring a lock on the schemas before upgrade. */\r\n BE_SQLITE_ERROR_SchemaLockFailed = (BE_SQLITE_IOERR | 18 << 24),\r\n /** Error upgrading the schemas in the database. */\r\n BE_SQLITE_ERROR_SchemaUpgradeFailed = (BE_SQLITE_IOERR | 19 << 24),\r\n /** Error importing the schemas into the database. */\r\n BE_SQLITE_ERROR_SchemaImportFailed = (BE_SQLITE_IOERR | 20 << 24),\r\n /** Error acquiring locks or codes */\r\n BE_SQLITE_ERROR_CouldNotAcquireLocksOrCodes = (BE_SQLITE_IOERR | 21 << 24),\r\n /** Recommended that the schemas found in the database be upgraded */\r\n BE_SQLITE_ERROR_SchemaUpgradeRecommended = (BE_SQLITE_IOERR | 22 << 24),\r\n /** schema update require data transform */\r\n BE_SQLITE_ERROR_DataTransformRequired = (BE_SQLITE_IOERR | (23 << 24)),\r\n\r\n BE_SQLITE_LOCKED_SHAREDCACHE = (BE_SQLITE_LOCKED | (1 << 8)),\r\n BE_SQLITE_BUSY_RECOVERY = (BE_SQLITE_BUSY | (1 << 8)),\r\n BE_SQLITE_CANTOPEN_NOTEMPDIR = (BE_SQLITE_CANTOPEN | (1 << 8)),\r\n BE_SQLITE_CANTOPEN_ISDIR = (BE_SQLITE_CANTOPEN | (2 << 8)),\r\n BE_SQLITE_CANTOPEN_FULLPATH = (BE_SQLITE_CANTOPEN | (3 << 8)),\r\n BE_SQLITE_CORRUPT_VTAB = (BE_SQLITE_CORRUPT | (1 << 8)),\r\n BE_SQLITE_READONLY_RECOVERY = (BE_SQLITE_READONLY | (1 << 8)),\r\n BE_SQLITE_READONLY_CANTLOCK = (BE_SQLITE_READONLY | (2 << 8)),\r\n BE_SQLITE_READONLY_ROLLBACK = (BE_SQLITE_READONLY | (3 << 8)),\r\n BE_SQLITE_ABORT_ROLLBACK = (BE_SQLITE_ABORT | (2 << 8)),\r\n BE_SQLITE_CONSTRAINT_CHECK = (BE_SQLITE_CONSTRAINT_BASE | (1 << 8)),\r\n BE_SQLITE_CONSTRAINT_COMMITHOOK = (BE_SQLITE_CONSTRAINT_BASE | (2 << 8)),\r\n BE_SQLITE_CONSTRAINT_FOREIGNKEY = (BE_SQLITE_CONSTRAINT_BASE | (3 << 8)),\r\n BE_SQLITE_CONSTRAINT_FUNCTION = (BE_SQLITE_CONSTRAINT_BASE | (4 << 8)),\r\n BE_SQLITE_CONSTRAINT_NOTNULL = (BE_SQLITE_CONSTRAINT_BASE | (5 << 8)),\r\n BE_SQLITE_CONSTRAINT_PRIMARYKEY = (BE_SQLITE_CONSTRAINT_BASE | (6 << 8)),\r\n BE_SQLITE_CONSTRAINT_TRIGGER = (BE_SQLITE_CONSTRAINT_BASE | (7 << 8)),\r\n BE_SQLITE_CONSTRAINT_UNIQUE = (BE_SQLITE_CONSTRAINT_BASE | (8 << 8)),\r\n BE_SQLITE_CONSTRAINT_VTAB = (BE_SQLITE_CONSTRAINT_BASE | (9 << 8)),\r\n}\r\n"]}
@@ -48,14 +48,14 @@ class ByteStream {
48
48
  */
49
49
  static fromUint8Array(bytes) {
50
50
  const { byteOffset, byteLength } = bytes;
51
- return new ByteStream(bytes.buffer, { byteOffset, byteLength }); // eslint-disable-line deprecation/deprecation
51
+ return new ByteStream(bytes.buffer, { byteOffset, byteLength }); // eslint-disable-line @typescript-eslint/no-deprecated
52
52
  }
53
53
  /** Construct a new ByteStream with the read position set to the beginning.
54
54
  * @param buffer The underlying buffer from which data is to be extracted.
55
55
  * @param subView If defined, specifies the subset of the underlying buffer's data to use.
56
56
  */
57
57
  static fromArrayBuffer(buffer, subView) {
58
- return new ByteStream(buffer, subView); // eslint-disable-line deprecation/deprecation
58
+ return new ByteStream(buffer, subView); // eslint-disable-line @typescript-eslint/no-deprecated
59
59
  }
60
60
  /** The number of bytes in this stream */
61
61
  get length() {
@@ -1 +1 @@
1
- {"version":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C,CAAC;QAC9F,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,0CAA0C;IAC1C,IAAW,WAAW,KAAsC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAE/E,IAAI,CAAC,QAAgB,EAAE,IAAgC;QAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA9JD,gCA8JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\nimport { assert } from \"./Assert\";\r\nimport { Id64, Id64String } from \"./Id\";\r\n\r\n/** Allows the contents of an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)\r\n * to be consumed sequentially using methods to extract\r\n * data of a particular type from the bytes beginning at the current read position.\r\n * Methods and properties beginning with 'read' and taking no arguments consume data at the current read position and advance it\r\n * by the size of the data read. The read position can also be directly adjusted by the caller.\r\n * @public\r\n */\r\nexport class ByteStream {\r\n private readonly _view: DataView;\r\n private readonly _byteOffset: number;\r\n private _curPos: number = 0;\r\n\r\n /** Construct a new ByteStream with the read position set to the beginning.\r\n * @param buffer The underlying buffer from which data is to be extracted.\r\n * @param subView If defined, specifies the subset of the underlying buffer's data to use.\r\n * This constructor is subject to two common mistakes:\r\n *\r\n * 1. Given `bytes: Uint8Array`, `new ByteStream(bytes)` will compile but at run-time will produce an error asserting that\r\n * the DataView constructor requires an ArrayBuffer. The correct usage is `new ByteStream(bytes.buffer)`.\r\n * 2. Given `bytes: Uint8Array`, `new ByteStream(bytes.buffer)` creates a stream for the entire range of bytes represented by the underlying\r\n * ArrayBuffer. If `bytes` represents only a **sub-range** of the underlying buffer's data, the results will be unexpected unless the optional `subView`\r\n * argument is supplied, with correct offset and length.\r\n *\r\n * For both of the above reasons, prefer to use [[fromUint8Array]].\r\n * @deprecated in 3.x. Use [[fromUint8Array]] or [[fromArrayBuffer]].\r\n */\r\n public constructor(buffer: ArrayBuffer | SharedArrayBuffer, subView?: { byteOffset: number, byteLength: number }) {\r\n if (undefined !== subView) {\r\n this._view = new DataView(buffer, subView.byteOffset, subView.byteLength);\r\n this._byteOffset = subView.byteOffset;\r\n } else {\r\n this._view = new DataView(buffer);\r\n this._byteOffset = 0;\r\n }\r\n }\r\n\r\n /** Construct a new ByteStream for the range of bytes represented by `bytes`, which may be a subset of the range of bytes\r\n * represented by the underlying ArrayBuffer. The read position will be set to the beginning of the range of bytes.\r\n */\r\n public static fromUint8Array(bytes: Uint8Array): ByteStream {\r\n const { byteOffset, byteLength } = bytes;\r\n return new ByteStream(bytes.buffer, { byteOffset, byteLength }); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Construct a new ByteStream with the read position set to the beginning.\r\n * @param buffer The underlying buffer from which data is to be extracted.\r\n * @param subView If defined, specifies the subset of the underlying buffer's data to use.\r\n */\r\n public static fromArrayBuffer(buffer: ArrayBuffer | SharedArrayBuffer, subView?: { byteOffset: number, byteLength: number }): ByteStream {\r\n return new ByteStream(buffer, subView); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** The number of bytes in this stream */\r\n public get length(): number {\r\n return this._view.byteLength;\r\n }\r\n\r\n /** The number of bytes remaining to be read, from [[curPos]] to the end of the stream. */\r\n public get remainingLength(): number {\r\n return this.length - this.curPos;\r\n }\r\n\r\n /** Returns true if the current read position has been advanced past the end of the stream. This generally indicates that an attempt was made to read more data than is available.\r\n * @see [[isAtTheEnd]]\r\n */\r\n public get isPastTheEnd(): boolean {\r\n return this.curPos > this.length;\r\n }\r\n\r\n /** Returns true if the current read position has advanced precisely to the end of the stream, indicating all of the data has been consumed.\r\n * @see [[isPastTheEnd]].\r\n */\r\n public get isAtTheEnd(): boolean {\r\n return this.curPos === this.length;\r\n }\r\n\r\n /** The current read position as an index into the stream of bytes. */\r\n public get curPos(): number { return this._curPos; }\r\n public set curPos(pos: number) {\r\n this._curPos = pos;\r\n assert(!this.isPastTheEnd);\r\n }\r\n\r\n /** Adds the specified number of bytes to the current read position */\r\n public advance(numBytes: number): boolean {\r\n this.curPos = (this.curPos + numBytes);\r\n return !this.isPastTheEnd;\r\n }\r\n\r\n /** Subtracts the specified number of bytes from the current read position */\r\n public rewind(numBytes: number): boolean {\r\n if (this.curPos - numBytes < 0)\r\n return false;\r\n\r\n this.curPos = this.curPos - numBytes;\r\n return true;\r\n }\r\n\r\n /** Resets the current read position to the beginning of the stream */\r\n public reset(): void { this.curPos = 0; }\r\n\r\n /** Read a unsigned 8-bit integer from the current read position and advance by 1 byte. */\r\n public readUint8(): number { return this.read(1, (view) => view.getUint8(this.curPos)); }\r\n /** Read an unsigned 16-bit integer from the current read position and advance by 2 bytes. */\r\n public readUint16(): number { return this.read(2, (view) => view.getUint16(this.curPos, true)); }\r\n /** Read an unsigned 32-bit integer from the current read position and advance by 4 bytes. */\r\n public readUint32(): number { return this.read(4, (view) => view.getUint32(this.curPos, true)); }\r\n /** Read a signed 32-bit integer from the current read position and advance by 4 bytes. */\r\n public readInt32(): number { return this.read(4, (view) => view.getInt32(this.curPos, true)); }\r\n /** Read a 32-bit floating point number from the current read position and advance by 4 bytes. */\r\n public readFloat32(): number { return this.read(4, (view) => view.getFloat32(this.curPos, true)); }\r\n /** Read a 64-bit floating point number from the current read position and advance by 8 bytes. */\r\n public readFloat64(): number { return this.read(8, (view) => view.getFloat64(this.curPos, true)); }\r\n /** Read an unsigned 64-bit integer from the current read position, advance by 8 bytes, and return the 64-bit value as an Id64String. */\r\n public readId64(): Id64String { return Id64.fromUint32Pair(this.readUint32(), this.readUint32()); }\r\n /** Read an unsigned 24-bit integer from the current read position and advance by 3 bytes. */\r\n public readUint24(): number { return this.readUint8() | (this.readUint8() << 8) | (this.readUint8() << 16); }\r\n\r\n /** @deprecated in 3.x. use [[readUint8]]. */\r\n public get nextUint8(): number { return this.readUint8(); }\r\n /** @deprecated in 3.x. use [[readUint16]]. */\r\n public get nextUint16(): number { return this.readUint16(); }\r\n /** @deprecated in 3.x. use [[readUint32]]. */\r\n public get nextUint32(): number { return this.readUint32(); }\r\n /** @deprecated in 3.x. use [[readInt32]]. */\r\n public get nextInt32(): number { return this.readInt32(); }\r\n /** @deprecated in 3.x. use [[readFloat32]]. */\r\n public get nextFloat32(): number { return this.readFloat32(); }\r\n /** @deprecated in 3.x. use [[readFloat64]]. */\r\n public get nextFloat64(): number { return this.readFloat64(); }\r\n /** @deprecated in 3.x. use [[readId64]]. */\r\n public get nextId64(): Id64String { return this.readId64(); }\r\n /** @deprecated in 3.x. use [[readUint32]]. */\r\n public get nextUint24(): number { return this.readUint24(); }\r\n\r\n /** Read the specified number of bytes beginning at the current read position into a Uint8Array and advance by the specified number of byte.\r\n * @param numBytes The number of bytes to read.\r\n */\r\n public nextBytes(numBytes: number): Uint8Array {\r\n const bytes = new Uint8Array(this.arrayBuffer, this.curPos + this._byteOffset, numBytes);\r\n this.advance(numBytes);\r\n return bytes;\r\n }\r\n\r\n /** Read the specified number of bytes at the specified offset without changing the read position. */\r\n public readBytes(readPos: number, numBytes: number): Uint8Array {\r\n return new Uint8Array(this.arrayBuffer, readPos + this._byteOffset, numBytes);\r\n }\r\n\r\n /** Read the specified number of unsigned 32-bit integers from the current read position and advance the read position. */\r\n public nextUint32s(numUint32s: number): Uint32Array {\r\n const numBytes = numUint32s * 4;\r\n const uint32s = new Uint32Array(this.arrayBuffer, this.curPos + this._byteOffset, numUint32s);\r\n this.advance(numBytes);\r\n return uint32s;\r\n }\r\n\r\n /** Returns the underlying array buffer */\r\n public get arrayBuffer(): ArrayBuffer | SharedArrayBuffer { return this._view.buffer; }\r\n\r\n private read(numBytes: number, read: (view: DataView) => number) {\r\n const result = read(this._view);\r\n this.advance(numBytes);\r\n return result;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ByteStream.js","sourceRoot":"","sources":["../../src/ByteStream.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qCAAkC;AAClC,6BAAwC;AAExC;;;;;;GAMG;AACH,MAAa,UAAU;IAKrB;;;;;;;;;;;;;OAaG;IACH,YAAmB,MAAuC,EAAE,OAAoD;QAhBxG,YAAO,GAAW,CAAC,CAAC;QAiB1B,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YAC1E,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,cAAc,CAAC,KAAiB;QAC5C,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;QACzC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,uDAAuD;IAC1H,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,MAAuC,EAAE,OAAoD;QACzH,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,uDAAuD;IACjG,CAAC;IAED,yCAAyC;IACzC,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;IAC/B,CAAC;IAED,0FAA0F;I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C,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC9F,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,0CAA0C;IAC1C,IAAW,WAAW,KAAsC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAE/E,IAAI,CAAC,QAAgB,EAAE,IAAgC;QAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA9JD,gCA8JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\nimport { assert } from \"./Assert\";\r\nimport { Id64, Id64String } from \"./Id\";\r\n\r\n/** Allows the contents of an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)\r\n * to be consumed sequentially using methods to extract\r\n * data of a particular type from the bytes beginning at the current read position.\r\n * Methods and properties beginning with 'read' and taking no arguments consume data at the current read position and advance it\r\n * by the size of the data read. The read position can also be directly adjusted by the caller.\r\n * @public\r\n */\r\nexport class ByteStream {\r\n private readonly _view: DataView;\r\n private readonly _byteOffset: number;\r\n private _curPos: number = 0;\r\n\r\n /** Construct a new ByteStream with the read position set to the beginning.\r\n * @param buffer The underlying buffer from which data is to be extracted.\r\n * @param subView If defined, specifies the subset of the underlying buffer's data to use.\r\n * This constructor is subject to two common mistakes:\r\n *\r\n * 1. Given `bytes: Uint8Array`, `new ByteStream(bytes)` will compile but at run-time will produce an error asserting that\r\n * the DataView constructor requires an ArrayBuffer. The correct usage is `new ByteStream(bytes.buffer)`.\r\n * 2. Given `bytes: Uint8Array`, `new ByteStream(bytes.buffer)` creates a stream for the entire range of bytes represented by the underlying\r\n * ArrayBuffer. If `bytes` represents only a **sub-range** of the underlying buffer's data, the results will be unexpected unless the optional `subView`\r\n * argument is supplied, with correct offset and length.\r\n *\r\n * For both of the above reasons, prefer to use [[fromUint8Array]].\r\n * @deprecated in 3.x. Use [[fromUint8Array]] or [[fromArrayBuffer]].\r\n */\r\n public constructor(buffer: ArrayBuffer | SharedArrayBuffer, subView?: { byteOffset: number, byteLength: number }) {\r\n if (undefined !== subView) {\r\n this._view = new DataView(buffer, subView.byteOffset, subView.byteLength);\r\n this._byteOffset = subView.byteOffset;\r\n } else {\r\n this._view = new DataView(buffer);\r\n this._byteOffset = 0;\r\n }\r\n }\r\n\r\n /** Construct a new ByteStream for the range of bytes represented by `bytes`, which may be a subset of the range of bytes\r\n * represented by the underlying ArrayBuffer. The read position will be set to the beginning of the range of bytes.\r\n */\r\n public static fromUint8Array(bytes: Uint8Array): ByteStream {\r\n const { byteOffset, byteLength } = bytes;\r\n return new ByteStream(bytes.buffer, { byteOffset, byteLength }); // eslint-disable-line @typescript-eslint/no-deprecated\r\n }\r\n\r\n /** Construct a new ByteStream with the read position set to the beginning.\r\n * @param buffer The underlying buffer from which data is to be extracted.\r\n * @param subView If defined, specifies the subset of the underlying buffer's data to use.\r\n */\r\n public static fromArrayBuffer(buffer: ArrayBuffer | SharedArrayBuffer, subView?: { byteOffset: number, byteLength: number }): ByteStream {\r\n return new ByteStream(buffer, subView); // eslint-disable-line @typescript-eslint/no-deprecated\r\n }\r\n\r\n /** The number of bytes in this stream */\r\n public get length(): number {\r\n return this._view.byteLength;\r\n }\r\n\r\n /** The number of bytes remaining to be read, from [[curPos]] to the end of the stream. */\r\n public get remainingLength(): number {\r\n return this.length - this.curPos;\r\n }\r\n\r\n /** Returns true if the current read position has been advanced past the end of the stream. This generally indicates that an attempt was made to read more data than is available.\r\n * @see [[isAtTheEnd]]\r\n */\r\n public get isPastTheEnd(): boolean {\r\n return this.curPos > this.length;\r\n }\r\n\r\n /** Returns true if the current read position has advanced precisely to the end of the stream, indicating all of the data has been consumed.\r\n * @see [[isPastTheEnd]].\r\n */\r\n public get isAtTheEnd(): boolean {\r\n return this.curPos === this.length;\r\n }\r\n\r\n /** The current read position as an index into the stream of bytes. */\r\n public get curPos(): number { return this._curPos; }\r\n public set curPos(pos: number) {\r\n this._curPos = pos;\r\n assert(!this.isPastTheEnd);\r\n }\r\n\r\n /** Adds the specified number of bytes to the current read position */\r\n public advance(numBytes: number): boolean {\r\n this.curPos = (this.curPos + numBytes);\r\n return !this.isPastTheEnd;\r\n }\r\n\r\n /** Subtracts the specified number of bytes from the current read position */\r\n public rewind(numBytes: number): boolean {\r\n if (this.curPos - numBytes < 0)\r\n return false;\r\n\r\n this.curPos = this.curPos - numBytes;\r\n return true;\r\n }\r\n\r\n /** Resets the current read position to the beginning of the stream */\r\n public reset(): void { this.curPos = 0; }\r\n\r\n /** Read a unsigned 8-bit integer from the current read position and advance by 1 byte. */\r\n public readUint8(): number { return this.read(1, (view) => view.getUint8(this.curPos)); }\r\n /** Read an unsigned 16-bit integer from the current read position and advance by 2 bytes. */\r\n public readUint16(): number { return this.read(2, (view) => view.getUint16(this.curPos, true)); }\r\n /** Read an unsigned 32-bit integer from the current read position and advance by 4 bytes. */\r\n public readUint32(): number { return this.read(4, (view) => view.getUint32(this.curPos, true)); }\r\n /** Read a signed 32-bit integer from the current read position and advance by 4 bytes. */\r\n public readInt32(): number { return this.read(4, (view) => view.getInt32(this.curPos, true)); }\r\n /** Read a 32-bit floating point number from the current read position and advance by 4 bytes. */\r\n public readFloat32(): number { return this.read(4, (view) => view.getFloat32(this.curPos, true)); }\r\n /** Read a 64-bit floating point number from the current read position and advance by 8 bytes. */\r\n public readFloat64(): number { return this.read(8, (view) => view.getFloat64(this.curPos, true)); }\r\n /** Read an unsigned 64-bit integer from the current read position, advance by 8 bytes, and return the 64-bit value as an Id64String. */\r\n public readId64(): Id64String { return Id64.fromUint32Pair(this.readUint32(), this.readUint32()); }\r\n /** Read an unsigned 24-bit integer from the current read position and advance by 3 bytes. */\r\n public readUint24(): number { return this.readUint8() | (this.readUint8() << 8) | (this.readUint8() << 16); }\r\n\r\n /** @deprecated in 3.x. use [[readUint8]]. */\r\n public get nextUint8(): number { return this.readUint8(); }\r\n /** @deprecated in 3.x. use [[readUint16]]. */\r\n public get nextUint16(): number { return this.readUint16(); }\r\n /** @deprecated in 3.x. use [[readUint32]]. */\r\n public get nextUint32(): number { return this.readUint32(); }\r\n /** @deprecated in 3.x. use [[readInt32]]. */\r\n public get nextInt32(): number { return this.readInt32(); }\r\n /** @deprecated in 3.x. use [[readFloat32]]. */\r\n public get nextFloat32(): number { return this.readFloat32(); }\r\n /** @deprecated in 3.x. use [[readFloat64]]. */\r\n public get nextFloat64(): number { return this.readFloat64(); }\r\n /** @deprecated in 3.x. use [[readId64]]. */\r\n public get nextId64(): Id64String { return this.readId64(); }\r\n /** @deprecated in 3.x. use [[readUint32]]. */\r\n public get nextUint24(): number { return this.readUint24(); }\r\n\r\n /** Read the specified number of bytes beginning at the current read position into a Uint8Array and advance by the specified number of byte.\r\n * @param numBytes The number of bytes to read.\r\n */\r\n public nextBytes(numBytes: number): Uint8Array {\r\n const bytes = new Uint8Array(this.arrayBuffer, this.curPos + this._byteOffset, numBytes);\r\n this.advance(numBytes);\r\n return bytes;\r\n }\r\n\r\n /** Read the specified number of bytes at the specified offset without changing the read position. */\r\n public readBytes(readPos: number, numBytes: number): Uint8Array {\r\n return new Uint8Array(this.arrayBuffer, readPos + this._byteOffset, numBytes);\r\n }\r\n\r\n /** Read the specified number of unsigned 32-bit integers from the current read position and advance the read position. */\r\n public nextUint32s(numUint32s: number): Uint32Array {\r\n const numBytes = numUint32s * 4;\r\n const uint32s = new Uint32Array(this.arrayBuffer, this.curPos + this._byteOffset, numUint32s);\r\n this.advance(numBytes);\r\n return uint32s;\r\n }\r\n\r\n /** Returns the underlying array buffer */\r\n public get arrayBuffer(): ArrayBuffer | SharedArrayBuffer { return this._view.buffer; }\r\n\r\n private read(numBytes: number, read: (view: DataView) => number) {\r\n const result = read(this._view);\r\n this.advance(numBytes);\r\n return result;\r\n }\r\n}\r\n"]}
@@ -7,7 +7,8 @@
7
7
  * @module Utils
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.isSubclassOf = exports.isProperSubclassOf = void 0;
10
+ exports.isProperSubclassOf = isProperSubclassOf;
11
+ exports.isSubclassOf = isSubclassOf;
11
12
  /** Check if class `subclass` is a different class from `superclass` but extends from `superclass`
12
13
  * @param subclass the class that may be a subclass of `superclass`
13
14
  * @param superclass the class that may be a base class of `subclass`
@@ -18,7 +19,6 @@ exports.isSubclassOf = exports.isProperSubclassOf = void 0;
18
19
  function isProperSubclassOf(subclass, superclass) {
19
20
  return subclass.prototype instanceof superclass;
20
21
  }
21
- exports.isProperSubclassOf = isProperSubclassOf;
22
22
  /** Check if class `subclass` is `superclass` or extends from `superclass`
23
23
  * @param subclass the class that may be a subclass of `superclass`.
24
24
  * @param superclass the class that may be a base class of `subclass`.
@@ -29,5 +29,4 @@ exports.isProperSubclassOf = isProperSubclassOf;
29
29
  function isSubclassOf(subclass, superclass) {
30
30
  return subclass === superclass || isProperSubclassOf(subclass, superclass);
31
31
  }
32
- exports.isSubclassOf = isSubclassOf;
33
32
  //# sourceMappingURL=ClassUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClassUtils.js","sourceRoot":"","sources":["../../src/ClassUtils.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAIhC,QAAgC,EAAE,UAAsB;IACxD,OAAO,QAAQ,CAAC,SAAS,YAAY,UAAU,CAAC;AAClD,CAAC;AAND,gDAMC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CAI1B,QAA6C,EAAE,UAAsB;IACrE,OAAO,QAAQ,KAAK,UAAU,IAAI,kBAAkB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC7E,CAAC;AAND,oCAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/** Check if class `subclass` is a different class from `superclass` but extends from `superclass`\r\n * @param subclass the class that may be a subclass of `superclass`\r\n * @param superclass the class that may be a base class of `subclass`\r\n * @note The constructors of all types must be `public`.\r\n * @returns whether `subclass` is a proper subclass of `superclass`\r\n * @public\r\n */\r\nexport function isProperSubclassOf<\r\n SuperClass extends new (..._: any[]) => any,\r\n NonSubClass extends new (..._: any[]) => any,\r\n SubClass extends new (..._: any[]) => InstanceType<SuperClass>,\r\n>(subclass: SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass {\r\n return subclass.prototype instanceof superclass;\r\n}\r\n\r\n/** Check if class `subclass` is `superclass` or extends from `superclass`\r\n * @param subclass the class that may be a subclass of `superclass`.\r\n * @param superclass the class that may be a base class of `subclass`.\r\n * @note The constructors of all types must be `public`.\r\n * @returns whether `subclass` is a subclass of `superclass`\r\n * @public\r\n */\r\nexport function isSubclassOf<\r\n SuperClass extends new (..._: any[]) => any,\r\n NonSubClass extends new (..._: any[]) => any,\r\n SubClass extends new (..._: any[]) => InstanceType<SuperClass>,\r\n>(subclass: SuperClass | SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass | SuperClass {\r\n return subclass === superclass || isProperSubclassOf(subclass, superclass);\r\n}\r\n"]}
1
+ {"version":3,"file":"ClassUtils.js","sourceRoot":"","sources":["../../src/ClassUtils.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AASH,gDAMC;AASD,oCAMC;AA5BD;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAIhC,QAAgC,EAAE,UAAsB;IACxD,OAAO,QAAQ,CAAC,SAAS,YAAY,UAAU,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CAI1B,QAA6C,EAAE,UAAsB;IACrE,OAAO,QAAQ,KAAK,UAAU,IAAI,kBAAkB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/** Check if class `subclass` is a different class from `superclass` but extends from `superclass`\r\n * @param subclass the class that may be a subclass of `superclass`\r\n * @param superclass the class that may be a base class of `subclass`\r\n * @note The constructors of all types must be `public`.\r\n * @returns whether `subclass` is a proper subclass of `superclass`\r\n * @public\r\n */\r\nexport function isProperSubclassOf<\r\n SuperClass extends new (..._: any[]) => any,\r\n NonSubClass extends new (..._: any[]) => any,\r\n SubClass extends new (..._: any[]) => InstanceType<SuperClass>,\r\n>(subclass: SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass {\r\n return subclass.prototype instanceof superclass;\r\n}\r\n\r\n/** Check if class `subclass` is `superclass` or extends from `superclass`\r\n * @param subclass the class that may be a subclass of `superclass`.\r\n * @param superclass the class that may be a base class of `subclass`.\r\n * @note The constructors of all types must be `public`.\r\n * @returns whether `subclass` is a subclass of `superclass`\r\n * @public\r\n */\r\nexport function isSubclassOf<\r\n SuperClass extends new (..._: any[]) => any,\r\n NonSubClass extends new (..._: any[]) => any,\r\n SubClass extends new (..._: any[]) => InstanceType<SuperClass>,\r\n>(subclass: SuperClass | SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass | SuperClass {\r\n return subclass === superclass || isProperSubclassOf(subclass, superclass);\r\n}\r\n"]}
@@ -7,7 +7,15 @@
7
7
  * @module Utils
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.areEqualPossiblyUndefined = exports.compareBooleansOrUndefined = exports.compareNumbersOrUndefined = exports.compareStringsOrUndefined = exports.comparePossiblyUndefined = exports.compareStrings = exports.compareBooleans = exports.compareNumbers = exports.compareWithTolerance = void 0;
10
+ exports.compareWithTolerance = compareWithTolerance;
11
+ exports.compareNumbers = compareNumbers;
12
+ exports.compareBooleans = compareBooleans;
13
+ exports.compareStrings = compareStrings;
14
+ exports.comparePossiblyUndefined = comparePossiblyUndefined;
15
+ exports.compareStringsOrUndefined = compareStringsOrUndefined;
16
+ exports.compareNumbersOrUndefined = compareNumbersOrUndefined;
17
+ exports.compareBooleansOrUndefined = compareBooleansOrUndefined;
18
+ exports.areEqualPossiblyUndefined = areEqualPossiblyUndefined;
11
19
  /**
12
20
  * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.
13
21
  * @public
@@ -20,22 +28,18 @@ function compareWithTolerance(a, b, tolerance = 0.1) {
20
28
  else
21
29
  return 0;
22
30
  }
23
- exports.compareWithTolerance = compareWithTolerance;
24
31
  /** @public */
25
32
  function compareNumbers(a, b) {
26
33
  return a - b;
27
34
  }
28
- exports.compareNumbers = compareNumbers;
29
35
  /** @public */
30
36
  function compareBooleans(a, b) {
31
37
  return a !== b ? (a < b ? -1 : 1) : 0;
32
38
  }
33
- exports.compareBooleans = compareBooleans;
34
39
  /** @public */
35
40
  function compareStrings(a, b) {
36
41
  return a === b ? 0 : (a < b ? -1 : 1);
37
42
  }
38
- exports.compareStrings = compareStrings;
39
43
  /** @public */
40
44
  function comparePossiblyUndefined(compareDefined, lhs, rhs) {
41
45
  if (undefined === lhs)
@@ -45,22 +49,18 @@ function comparePossiblyUndefined(compareDefined, lhs, rhs) {
45
49
  else
46
50
  return compareDefined(lhs, rhs);
47
51
  }
48
- exports.comparePossiblyUndefined = comparePossiblyUndefined;
49
52
  /** @public */
50
53
  function compareStringsOrUndefined(lhs, rhs) {
51
54
  return comparePossiblyUndefined(compareStrings, lhs, rhs);
52
55
  }
53
- exports.compareStringsOrUndefined = compareStringsOrUndefined;
54
56
  /** @public */
55
57
  function compareNumbersOrUndefined(lhs, rhs) {
56
58
  return comparePossiblyUndefined(compareNumbers, lhs, rhs);
57
59
  }
58
- exports.compareNumbersOrUndefined = compareNumbersOrUndefined;
59
60
  /** @public */
60
61
  function compareBooleansOrUndefined(lhs, rhs) {
61
62
  return comparePossiblyUndefined(compareBooleans, lhs, rhs);
62
63
  }
63
- exports.compareBooleansOrUndefined = compareBooleansOrUndefined;
64
64
  /** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.
65
65
  * @public
66
66
  */
@@ -72,5 +72,4 @@ function areEqualPossiblyUndefined(t, u, areEqual) {
72
72
  else
73
73
  return areEqual(t, u);
74
74
  }
75
- exports.areEqualPossiblyUndefined = areEqualPossiblyUndefined;
76
75
  //# sourceMappingURL=Compare.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Compare.js","sourceRoot":"","sources":["../../src/Compare.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwBH;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,CAAS,EAAE,CAAS,EAAE,SAAS,GAAG,GAAG;IACxE,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS;QACnB,OAAO,CAAC,CAAC,CAAC;SACP,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS;QACxB,OAAO,CAAC,CAAC;;QAET,OAAO,CAAC,CAAC;AACb,CAAC;AAPD,oDAOC;AAED,cAAc;AACd,SAAgB,cAAc,CAAC,CAAS,EAAE,CAAS;IACjD,OAAO,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAFD,wCAEC;AAED,cAAc;AACd,SAAgB,eAAe,CAAC,CAAU,EAAE,CAAU;IACpD,OAAO,CAAC,KA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E,CAAgB,EAAE,QAAiC;IACnH,IAAI,SAAS,KAAK,CAAC;QACjB,OAAO,SAAS,KAAK,CAAC,CAAC;SACpB,IAAI,SAAS,KAAK,CAAC;QACtB,OAAO,KAAK,CAAC;;QAEb,OAAO,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC;AAPD,8DAOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/**\r\n * A function that returns a numerical value indicating how two objects are ordered in relation to one another.\r\n * Such functions are used by various collection classes throughout the library.\r\n * Given values `lhs` and `rhs`, the function returns:\r\n * - Zero if lhs == rhs\r\n * - A negative number if lhs < rhs\r\n * - A positive number if lhs > rhs\r\n *\r\n * An OrderedComparator `must` implement [strict weak ordering](https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings), which can be summarized by the following rules:\r\n * - `compare(x, x)` returns zero.\r\n * - If `compare(x, y)` returns zero, then so does `compare(y, x)` (i.e., `x == y` implies `y == x`).\r\n * - If `compare(x, y)` returns non-zero, then `compare(y, x)` returns a value with an opposite sign (i.e., `x < y` implies `y > x`).\r\n * - If `compare(x, y)` and `compare(y, z)` return non-zero values with the same sign, then `compare(x, z)` returns a value with the same sign (i.e., `x < y < z` implies `x < z`).\r\n *\r\n * @see SortedArray\r\n * @see Dictionary\r\n * @see IndexMap\r\n * @see PriorityQueue\r\n * @public\r\n */\r\nexport type OrderedComparator<T, U = T> = (lhs: T, rhs: U) => number;\r\n\r\n/**\r\n * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.\r\n * @public\r\n */\r\nexport function compareWithTolerance(a: number, b: number, tolerance = 0.1): number {\r\n if (a < b - tolerance)\r\n return -1;\r\n else if (a > b + tolerance)\r\n return 1;\r\n else\r\n return 0;\r\n}\r\n\r\n/** @public */\r\nexport function compareNumbers(a: number, b: number): number {\r\n return a - b;\r\n}\r\n\r\n/** @public */\r\nexport function compareBooleans(a: boolean, b: boolean): number {\r\n return a !== b ? (a < b ? -1 : 1) : 0;\r\n}\r\n\r\n/** @public */\r\nexport function compareStrings(a: string, b: string): number {\r\n return a === b ? 0 : (a < b ? -1 : 1);\r\n}\r\n\r\n/** @public */\r\nexport function comparePossiblyUndefined<T>(compareDefined: (lhs: T, rhs: T) => number, lhs?: T, rhs?: T): number {\r\n if (undefined === lhs)\r\n return undefined === rhs ? 0 : -1;\r\n else if (undefined === rhs)\r\n return 1;\r\n else\r\n return compareDefined(lhs, rhs);\r\n}\r\n\r\n/** @public */\r\nexport function compareStringsOrUndefined(lhs?: string, rhs?: string): number {\r\n return comparePossiblyUndefined(compareStrings, lhs, rhs);\r\n}\r\n\r\n/** @public */\r\nexport function compareNumbersOrUndefined(lhs?: number, rhs?: number): number {\r\n return comparePossiblyUndefined(compareNumbers, lhs, rhs);\r\n}\r\n\r\n/** @public */\r\nexport function compareBooleansOrUndefined(lhs?: boolean, rhs?: boolean): number {\r\n return comparePossiblyUndefined(compareBooleans, lhs, rhs);\r\n}\r\n\r\n/** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.\r\n * @public\r\n */\r\nexport function areEqualPossiblyUndefined<T, U>(t: T | undefined, u: U | undefined, areEqual: (t: T, u: U) => boolean): boolean {\r\n if (undefined === t)\r\n return undefined === u;\r\n else if (undefined === u)\r\n return false;\r\n else\r\n return areEqual(t, u);\r\n}\r\n"]}
1
+ {"version":3,"file":"Compare.js","sourceRoot":"","sources":["../../src/Compare.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AA4BH,oDAOC;AAGD,wCAEC;AAGD,0CAEC;AAGD,wCAEC;AAGD,4DAOC;AAGD,8DAEC;AAGD,8DAEC;AAGD,gEAEC;AAKD,8DAOC;AA/DD;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CAAC;AAC5D,CAAC;AAED,cAAc;AACd,SAAgB,yBAAyB,CAAC,GAAY,EAAE,GAAY;IAClE,OAAO,wBAAwB,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC;AAED,cAAc;AACd,SAAgB,0BAA0B,CAAC,GAAa,EAAE,GAAa;IACrE,OAAO,wBAAwB,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CAAO,CAAgB,EAAE,CAAgB,EAAE,QAAiC;IACnH,IAAI,SAAS,KAAK,CAAC;QACjB,OAAO,SAAS,KAAK,CAAC,CAAC;SACpB,IAAI,SAAS,KAAK,CAAC;QACtB,OAAO,KAAK,CAAC;;QAEb,OAAO,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/**\r\n * A function that returns a numerical value indicating how two objects are ordered in relation to one another.\r\n * Such functions are used by various collection classes throughout the library.\r\n * Given values `lhs` and `rhs`, the function returns:\r\n * - Zero if lhs == rhs\r\n * - A negative number if lhs < rhs\r\n * - A positive number if lhs > rhs\r\n *\r\n * An OrderedComparator `must` implement [strict weak ordering](https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings), which can be summarized by the following rules:\r\n * - `compare(x, x)` returns zero.\r\n * - If `compare(x, y)` returns zero, then so does `compare(y, x)` (i.e., `x == y` implies `y == x`).\r\n * - If `compare(x, y)` returns non-zero, then `compare(y, x)` returns a value with an opposite sign (i.e., `x < y` implies `y > x`).\r\n * - If `compare(x, y)` and `compare(y, z)` return non-zero values with the same sign, then `compare(x, z)` returns a value with the same sign (i.e., `x < y < z` implies `x < z`).\r\n *\r\n * @see SortedArray\r\n * @see Dictionary\r\n * @see IndexMap\r\n * @see PriorityQueue\r\n * @public\r\n */\r\nexport type OrderedComparator<T, U = T> = (lhs: T, rhs: U) => number;\r\n\r\n/**\r\n * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.\r\n * @public\r\n */\r\nexport function compareWithTolerance(a: number, b: number, tolerance = 0.1): number {\r\n if (a < b - tolerance)\r\n return -1;\r\n else if (a > b + tolerance)\r\n return 1;\r\n else\r\n return 0;\r\n}\r\n\r\n/** @public */\r\nexport function compareNumbers(a: number, b: number): number {\r\n return a - b;\r\n}\r\n\r\n/** @public */\r\nexport function compareBooleans(a: boolean, b: boolean): number {\r\n return a !== b ? (a < b ? -1 : 1) : 0;\r\n}\r\n\r\n/** @public */\r\nexport function compareStrings(a: string, b: string): number {\r\n return a === b ? 0 : (a < b ? -1 : 1);\r\n}\r\n\r\n/** @public */\r\nexport function comparePossiblyUndefined<T>(compareDefined: (lhs: T, rhs: T) => number, lhs?: T, rhs?: T): number {\r\n if (undefined === lhs)\r\n return undefined === rhs ? 0 : -1;\r\n else if (undefined === rhs)\r\n return 1;\r\n else\r\n return compareDefined(lhs, rhs);\r\n}\r\n\r\n/** @public */\r\nexport function compareStringsOrUndefined(lhs?: string, rhs?: string): number {\r\n return comparePossiblyUndefined(compareStrings, lhs, rhs);\r\n}\r\n\r\n/** @public */\r\nexport function compareNumbersOrUndefined(lhs?: number, rhs?: number): number {\r\n return comparePossiblyUndefined(compareNumbers, lhs, rhs);\r\n}\r\n\r\n/** @public */\r\nexport function compareBooleansOrUndefined(lhs?: boolean, rhs?: boolean): number {\r\n return comparePossiblyUndefined(compareBooleans, lhs, rhs);\r\n}\r\n\r\n/** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.\r\n * @public\r\n */\r\nexport function areEqualPossiblyUndefined<T, U>(t: T | undefined, u: U | undefined, areEqual: (t: T, u: U) => boolean): boolean {\r\n if (undefined === t)\r\n return undefined === u;\r\n else if (undefined === u)\r\n return false;\r\n else\r\n return areEqual(t, u);\r\n}\r\n"]}
@@ -116,7 +116,7 @@ export declare class MutableCompressedId64Set implements OrderedId64Iterable {
116
116
  /** Remove all Ids from the set, then add the specified Ids. */
117
117
  reset(ids?: CompressedId64Set): void;
118
118
  /** Obtain an iterator over the Ids in this set. The Ids are returned in ascending order based on their unsigned 64-bit integer values. */
119
- [Symbol.iterator](): Iterator<string, any, undefined>;
119
+ [Symbol.iterator](): Iterator<string, any, any>;
120
120
  /** Compute a compact string representation of the union of this and another set of Ids - i.e., those Ids present in either this and/or the other set. */
121
121
  computeUnion(ids: OrderedId64Iterable | CompressedId64Set | MutableCompressedId64Set): CompressedId64Set;
122
122
  /** Compute a compact string representation of the intersection of this and another set of Ids - i.e., those Ids present in both this and the other set. */
@@ -1 +1 @@
1
- {"version":3,"file":"Disposable.d.ts","sourceRoot":"","sources":["../../src/Disposable.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAG9D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,UAAU,CAAC,EAAE,WAAW,GAAG,SAAS,CAI3D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,GAAG,SAAS,CAS5D;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,OAAO,GAAG,OAAO,CAkB/G;AAED;;GAEG;AAC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,CAAC,WAAW,GAAG,WAAW,CAAM;IAO9D,OAAO,CAAC,YAAY;IAIpB,uCAAuC;IAChC,GAAG,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW;IAOhD,oCAAoC;IAC7B,MAAM,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI;IAM5C,uCAAuC;IAChC,OAAO,IAAI,IAAI;CAIvB"}
@@ -7,16 +7,18 @@
7
7
  * @module Utils
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.DisposableList = exports.using = exports.disposeArray = exports.dispose = exports.isIDisposable = void 0;
10
+ exports.DisposableList = void 0;
11
+ exports.isIDisposable = isIDisposable;
12
+ exports.dispose = dispose;
13
+ exports.disposeArray = disposeArray;
14
+ exports.using = using;
11
15
  /**
12
16
  * A type guard that checks whether the given argument implements `IDisposable` interface
13
17
  * @public
14
18
  */
15
19
  function isIDisposable(obj) {
16
- // eslint-disable-next-line @typescript-eslint/unbound-method
17
20
  return !!obj && (obj instanceof Object) && !!obj.dispose && (typeof obj.dispose === "function");
18
21
  }
19
- exports.isIDisposable = isIDisposable;
20
22
  /** Convenience function for disposing of a disposable object that may be undefined.
21
23
  * This is primarily used to simplify implementations of [[IDisposable.dispose]].
22
24
  * As a simple example:
@@ -40,7 +42,6 @@ function dispose(disposable) {
40
42
  disposable.dispose();
41
43
  return undefined;
42
44
  }
43
- exports.dispose = dispose;
44
45
  /** Disposes of and empties a list of disposable objects.
45
46
  * @param list The list of disposable objects.
46
47
  * @returns undefined
@@ -54,7 +55,6 @@ function disposeArray(list) {
54
55
  list.length = 0;
55
56
  return undefined;
56
57
  }
57
- exports.disposeArray = disposeArray;
58
58
  /** A 'using' function which is a substitution for .NET's using statement. It makes sure that 'dispose'
59
59
  * is called on the resource no matter if the func returns or throws. If func returns, the return value
60
60
  * of this function is equal to return value of func. If func throws, this function also throws (after
@@ -79,7 +79,6 @@ function using(resources, func) {
79
79
  doDispose();
80
80
  }
81
81
  }
82
- exports.using = using;
83
82
  class FuncDisposable {
84
83
  constructor(disposeFunc) { this._disposeFunc = disposeFunc; }
85
84
  dispose() { this._disposeFunc(); }
@@ -1 +1 @@
1
- {"version":3,"file":"Disposable.js","sourceRoot":"","sources":["../../src/Disposable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwBH;;;GAGG;AACH,SAAgB,aAAa,CAAC,GAAY;IACxC,6DAA6D;IAC7D,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,YAAY,MAAM,CAAC,IAAI,CAAC,CAAE,GAAmB,CAAC,OAAO,IAAI,CAAC,OAAQ,GAAmB,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;AACpI,CAAC;AAHD,sCAGC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,OAAO,CAAC,UAAwB;IAC9C,IAAI,SAAS,KAAK,UAAU;QAC1B,UAAU,CAAC,OAAO,EAAE,CAAC;IACvB,OAAO,SAAS,CAAC;AACnB,CAAC;AAJD,0BAIC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAoB;IAC/C,IAAI,SAAS,KAAK,IAAI;QACpB,OAAO,SAAS,CAAC;IAEnB,KAAK,MAAM,KAAK,IAAI,IAAI;QACtB,OAAO,CAAC,KAAK,CAAC,CAAC;IAEjB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAChB,OAAO,SAAS,CAAC;AACnB,CAAC;AATD,oCASC;AAED;;;;;GAKG;AACH,SAAgB,KAAK,CAAiC,SAAkB,EAAE,IAA4B;IACpG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;QAC3B,OAAO,KAAK,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;IAElC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,IAAI,wBAA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AAC,CAAC;QAClD,IAAI,CAAC,CAAC,KAAK,GAAG;YACZ,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,uCAAuC;IAChC,OAAO;QACZ,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,YAAY;YACxC,UAAU,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACF;AAnCD,wCAmCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/** Interface adopted by a type which has deterministic cleanup logic.\r\n * For example:\r\n * - Most rendering-related types, such as [[RenderGraphic]] and [[Viewport]], own WebGL resources which must be explicitly released when no longer needed.\r\n * - Some low-level objects like [[ECDb]] own native types defined in C++ code which must be explicitly released when no longer needed.\r\n *\r\n * A similar concept exists in languages like C++ (implemented as \"destructors\") and C# (\"IDisposable\").\r\n * However, because TypeScript and Javascript lack any built-in support for deterministic destruction, it is up to the programmer to ensure dispose() is called appropriately.\r\n * Failure to do so may result in memory leaks or leaking of other resources.\r\n *\r\n * IDisposable tends to be contagious; that is, if a type has members which implement IDisposable, that type should also implement IDisposable to dispose of those members.\r\n *\r\n * Implementations of IDisposable tend to be more \"low-level\" types. The disposal of such types is often handled on your behalf.\r\n * However, always consult the documentation for an IDisposable type to determine under what circumstances you are expected to explicitly dispose of it.\r\n * @public\r\n */\r\nexport interface IDisposable {\r\n /** Disposes of any resources owned by this object.\r\n * @note The object is generally considered unusable after it has been disposed of.\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * A type guard that checks whether the given argument implements `IDisposable` interface\r\n * @public\r\n */\r\nexport function isIDisposable(obj: unknown): obj is IDisposable {\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n return !!obj && (obj instanceof Object) && !!(obj as IDisposable).dispose && (typeof (obj as IDisposable).dispose === \"function\");\r\n}\r\n\r\n/** Convenience function for disposing of a disposable object that may be undefined.\r\n * This is primarily used to simplify implementations of [[IDisposable.dispose]].\r\n * As a simple example:\r\n * ```ts\r\n * class Disposable implements IDisposable {\r\n * public member1?: DisposableType1;\r\n * public member2?: DisposableType2;\r\n *\r\n * public dispose() {\r\n * this.member1 = dispose(this.member1); // If member1 is defined, dispose of it and set it to undefined.\r\n * this.member2 = dispose(this.member2); // Likewise for member2.\r\n * }\r\n * }\r\n * ```\r\n * @param disposable The object to be disposed of.\r\n * @returns undefined\r\n * @public\r\n */\r\nexport function dispose(disposable?: IDisposable): undefined {\r\n if (undefined !== disposable)\r\n disposable.dispose();\r\n return undefined;\r\n}\r\n\r\n/** Disposes of and empties a list of disposable objects.\r\n * @param list The list of disposable objects.\r\n * @returns undefined\r\n * @public\r\n */\r\nexport function disposeArray(list?: IDisposable[]): undefined {\r\n if (undefined === list)\r\n return undefined;\r\n\r\n for (const entry of list)\r\n dispose(entry);\r\n\r\n list.length = 0;\r\n return undefined;\r\n}\r\n\r\n/** A 'using' function which is a substitution for .NET's using statement. It makes sure that 'dispose'\r\n * is called on the resource no matter if the func returns or throws. If func returns, the return value\r\n * of this function is equal to return value of func. If func throws, this function also throws (after\r\n * disposing the resource).\r\n * @public\r\n */\r\nexport function using<T extends IDisposable, TResult>(resources: T | T[], func: (...r: T[]) => TResult): TResult {\r\n if (!Array.isArray(resources))\r\n return using([resources], func);\r\n\r\n const doDispose = () => resources.forEach((disposable) => disposable.dispose());\r\n let shouldDisposeImmediately = true;\r\n\r\n try {\r\n const result = func(...resources);\r\n if (result instanceof Promise) {\r\n shouldDisposeImmediately = false;\r\n result.then(doDispose, doDispose);\r\n }\r\n return result;\r\n } finally {\r\n if (shouldDisposeImmediately)\r\n doDispose();\r\n }\r\n}\r\n\r\n/** A definition of function which may be called to dispose an object\r\n * @public\r\n */\r\nexport type DisposeFunc = () => void;\r\n\r\nclass FuncDisposable implements IDisposable {\r\n private _disposeFunc: () => void;\r\n constructor(disposeFunc: () => void) { this._disposeFunc = disposeFunc; }\r\n public dispose() { this._disposeFunc(); }\r\n}\r\n\r\n/** A disposable container of disposable objects.\r\n * @public\r\n */\r\nexport class DisposableList implements IDisposable {\r\n private _disposables: IDisposable[];\r\n\r\n /** Creates a disposable list. */\r\n constructor(disposables: Array<IDisposable | DisposeFunc> = []) {\r\n this._disposables = [];\r\n disposables.forEach((disposable) => {\r\n this.add(disposable);\r\n });\r\n }\r\n\r\n private isDisposable(x: IDisposable | DisposeFunc): x is IDisposable {\r\n return (x as IDisposable).dispose !== undefined;\r\n }\r\n\r\n /** Register an object for disposal. */\r\n public add(disposable: IDisposable | DisposeFunc) {\r\n if (this.isDisposable(disposable))\r\n this._disposables.push(disposable);\r\n else\r\n this._disposables.push(new FuncDisposable(disposable));\r\n }\r\n\r\n /** Unregister disposable object. */\r\n public remove(disposable: IDisposable): void {\r\n const idx = this._disposables.indexOf(disposable);\r\n if (-1 !== idx)\r\n this._disposables.splice(idx, 1);\r\n }\r\n\r\n /** Disposes all registered objects. */\r\n public dispose(): void {\r\n for (const disposable of this._disposables)\r\n disposable.dispose();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Disposable.js","sourceRoot":"","sources":["../../src/Disposable.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA4BH,sCAEC;AAoBD,0BAIC;AAOD,oCASC;AAQD,sBAkBC;AAxED;;;GAGG;AACH,SAAgB,aAAa,CAAC,GAAY;IACxC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,YAAY,MAAM,CAAC,IAAI,CAAC,CAAE,GAAmB,CAAC,OAAO,IAAI,CAAC,OAAQ,GAAmB,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;AACpI,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,OAAO,CAAC,UAAwB;IAC9C,IAAI,SAAS,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AiC;IACjC,YAAY,cAAgD,EAAE;QAC5D,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,YAAY,CAAC,CAA4B;QAC/C,OAAQ,CAAiB,CAAC,OAAO,KAAK,SAAS,CAAC;IAClD,CAAC;IAED,uCAAuC;IAChC,GAAG,CAAC,UAAqC;QAC9C,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;YAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;;YAEnC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,oCAAoC;IAC7B,MAAM,CAAC,UAAuB;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAClD,IAAI,CAAC,CAAC,KAAK,GAAG;YACZ,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,uCAAuC;IAChC,OAAO;QACZ,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,YAAY;YACxC,UAAU,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;CACF;AAnCD,wCAmCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utils\r\n */\r\n\r\n/** Interface adopted by a type which has deterministic cleanup logic.\r\n * For example:\r\n * - Most rendering-related types, such as [[RenderGraphic]] and [[Viewport]], own WebGL resources which must be explicitly released when no longer needed.\r\n * - Some low-level objects like [[ECDb]] own native types defined in C++ code which must be explicitly released when no longer needed.\r\n *\r\n * A similar concept exists in languages like C++ (implemented as \"destructors\") and C# (\"IDisposable\").\r\n * However, because TypeScript and Javascript lack any built-in support for deterministic destruction, it is up to the programmer to ensure dispose() is called appropriately.\r\n * Failure to do so may result in memory leaks or leaking of other resources.\r\n *\r\n * IDisposable tends to be contagious; that is, if a type has members which implement IDisposable, that type should also implement IDisposable to dispose of those members.\r\n *\r\n * Implementations of IDisposable tend to be more \"low-level\" types. The disposal of such types is often handled on your behalf.\r\n * However, always consult the documentation for an IDisposable type to determine under what circumstances you are expected to explicitly dispose of it.\r\n * @public\r\n */\r\nexport interface IDisposable {\r\n /** Disposes of any resources owned by this object.\r\n * @note The object is generally considered unusable after it has been disposed of.\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * A type guard that checks whether the given argument implements `IDisposable` interface\r\n * @public\r\n */\r\nexport function isIDisposable(obj: unknown): obj is IDisposable {\r\n return !!obj && (obj instanceof Object) && !!(obj as IDisposable).dispose && (typeof (obj as IDisposable).dispose === \"function\");\r\n}\r\n\r\n/** Convenience function for disposing of a disposable object that may be undefined.\r\n * This is primarily used to simplify implementations of [[IDisposable.dispose]].\r\n * As a simple example:\r\n * ```ts\r\n * class Disposable implements IDisposable {\r\n * public member1?: DisposableType1;\r\n * public member2?: DisposableType2;\r\n *\r\n * public dispose() {\r\n * this.member1 = dispose(this.member1); // If member1 is defined, dispose of it and set it to undefined.\r\n * this.member2 = dispose(this.member2); // Likewise for member2.\r\n * }\r\n * }\r\n * ```\r\n * @param disposable The object to be disposed of.\r\n * @returns undefined\r\n * @public\r\n */\r\nexport function dispose(disposable?: IDisposable): undefined {\r\n if (undefined !== disposable)\r\n disposable.dispose();\r\n return undefined;\r\n}\r\n\r\n/** Disposes of and empties a list of disposable objects.\r\n * @param list The list of disposable objects.\r\n * @returns undefined\r\n * @public\r\n */\r\nexport function disposeArray(list?: IDisposable[]): undefined {\r\n if (undefined === list)\r\n return undefined;\r\n\r\n for (const entry of list)\r\n dispose(entry);\r\n\r\n list.length = 0;\r\n return undefined;\r\n}\r\n\r\n/** A 'using' function which is a substitution for .NET's using statement. It makes sure that 'dispose'\r\n * is called on the resource no matter if the func returns or throws. If func returns, the return value\r\n * of this function is equal to return value of func. If func throws, this function also throws (after\r\n * disposing the resource).\r\n * @public\r\n */\r\nexport function using<T extends IDisposable, TResult>(resources: T | T[], func: (...r: T[]) => TResult): TResult {\r\n if (!Array.isArray(resources))\r\n return using([resources], func);\r\n\r\n const doDispose = () => resources.forEach((disposable) => disposable.dispose());\r\n let shouldDisposeImmediately = true;\r\n\r\n try {\r\n const result = func(...resources);\r\n if (result instanceof Promise) {\r\n shouldDisposeImmediately = false;\r\n result.then(doDispose, doDispose);\r\n }\r\n return result;\r\n } finally {\r\n if (shouldDisposeImmediately)\r\n doDispose();\r\n }\r\n}\r\n\r\n/** A definition of function which may be called to dispose an object\r\n * @public\r\n */\r\nexport type DisposeFunc = () => void;\r\n\r\nclass FuncDisposable implements IDisposable {\r\n private _disposeFunc: () => void;\r\n constructor(disposeFunc: () => void) { this._disposeFunc = disposeFunc; }\r\n public dispose() { this._disposeFunc(); }\r\n}\r\n\r\n/** A disposable container of disposable objects.\r\n * @public\r\n */\r\nexport class DisposableList implements IDisposable {\r\n private _disposables: IDisposable[];\r\n\r\n /** Creates a disposable list. */\r\n constructor(disposables: Array<IDisposable | DisposeFunc> = []) {\r\n this._disposables = [];\r\n disposables.forEach((disposable) => {\r\n this.add(disposable);\r\n });\r\n }\r\n\r\n private isDisposable(x: IDisposable | DisposeFunc): x is IDisposable {\r\n return (x as IDisposable).dispose !== undefined;\r\n }\r\n\r\n /** Register an object for disposal. */\r\n public add(disposable: IDisposable | DisposeFunc) {\r\n if (this.isDisposable(disposable))\r\n this._disposables.push(disposable);\r\n else\r\n this._disposables.push(new FuncDisposable(disposable));\r\n }\r\n\r\n /** Unregister disposable object. */\r\n public remove(disposable: IDisposable): void {\r\n const idx = this._disposables.indexOf(disposable);\r\n if (-1 !== idx)\r\n this._disposables.splice(idx, 1);\r\n }\r\n\r\n /** Disposes all registered objects. */\r\n public dispose(): void {\r\n for (const disposable of this._disposables)\r\n disposable.dispose();\r\n }\r\n}\r\n"]}
package/lib/cjs/Id.js CHANGED
@@ -308,7 +308,7 @@ var Id64;
308
308
  Id64.iterable = iterable;
309
309
  /** Return the first [[Id64String]] of an [[Id64Arg]]. */
310
310
  function getFirst(arg) {
311
- return typeof arg === "string" ? arg : (Array.isArray(arg) ? arg[0] : arg.values().next().value);
311
+ return typeof arg === "string" ? arg : (Array.isArray(arg) ? arg[0] : arg.values().next().value) ?? Id64.invalid;
312
312
  }
313
313
  Id64.getFirst = getFirst;
314
314
  /** Return the number of [[Id64String]]s represented by an [[Id64Arg]]. */