@itwin/core-bentley 4.0.0-dev.8 → 4.0.0-dev.81

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 (254) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/lib/cjs/AccessToken.d.ts +10 -10
  3. package/lib/cjs/AccessToken.d.ts.map +1 -1
  4. package/lib/cjs/AccessToken.js +9 -9
  5. package/lib/cjs/AccessToken.js.map +1 -1
  6. package/lib/cjs/Assert.d.ts +25 -25
  7. package/lib/cjs/Assert.js +45 -45
  8. package/lib/cjs/Assert.js.map +1 -1
  9. package/lib/cjs/BeEvent.d.ts +81 -81
  10. package/lib/cjs/BeEvent.d.ts.map +1 -1
  11. package/lib/cjs/BeEvent.js +156 -156
  12. package/lib/cjs/BeEvent.js.map +1 -1
  13. package/lib/cjs/BeSQLite.d.ts +172 -170
  14. package/lib/cjs/BeSQLite.d.ts.map +1 -1
  15. package/lib/cjs/BeSQLite.js +185 -183
  16. package/lib/cjs/BeSQLite.js.map +1 -1
  17. package/lib/cjs/BentleyError.d.ts +378 -378
  18. package/lib/cjs/BentleyError.d.ts.map +1 -1
  19. package/lib/cjs/BentleyError.js +703 -702
  20. package/lib/cjs/BentleyError.js.map +1 -1
  21. package/lib/cjs/BentleyLoggerCategory.d.ts +11 -11
  22. package/lib/cjs/BentleyLoggerCategory.js +19 -19
  23. package/lib/cjs/BentleyLoggerCategory.js.map +1 -1
  24. package/lib/cjs/ByteStream.d.ts +110 -110
  25. package/lib/cjs/ByteStream.js +159 -159
  26. package/lib/cjs/ByteStream.js.map +1 -1
  27. package/lib/cjs/ClassUtils.d.ts +14 -14
  28. package/lib/cjs/ClassUtils.js +27 -27
  29. package/lib/cjs/ClassUtils.js.map +1 -1
  30. package/lib/cjs/Compare.d.ts +47 -47
  31. package/lib/cjs/Compare.d.ts.map +1 -1
  32. package/lib/cjs/Compare.js +75 -75
  33. package/lib/cjs/Compare.js.map +1 -1
  34. package/lib/cjs/CompressedId64Set.d.ts +134 -134
  35. package/lib/cjs/CompressedId64Set.d.ts.map +1 -1
  36. package/lib/cjs/CompressedId64Set.js +428 -428
  37. package/lib/cjs/CompressedId64Set.js.map +1 -1
  38. package/lib/cjs/Dictionary.d.ts +125 -125
  39. package/lib/cjs/Dictionary.js +203 -203
  40. package/lib/cjs/Dictionary.js.map +1 -1
  41. package/lib/cjs/Disposable.d.ts +80 -80
  42. package/lib/cjs/Disposable.d.ts.map +1 -1
  43. package/lib/cjs/Disposable.js +120 -120
  44. package/lib/cjs/Disposable.js.map +1 -1
  45. package/lib/cjs/Id.d.ts +285 -285
  46. package/lib/cjs/Id.d.ts.map +1 -1
  47. package/lib/cjs/Id.js +643 -643
  48. package/lib/cjs/Id.js.map +1 -1
  49. package/lib/cjs/IndexMap.d.ts +65 -65
  50. package/lib/cjs/IndexMap.js +91 -91
  51. package/lib/cjs/IndexMap.js.map +1 -1
  52. package/lib/cjs/JsonSchema.d.ts +77 -77
  53. package/lib/cjs/JsonSchema.d.ts.map +1 -1
  54. package/lib/cjs/JsonSchema.js +9 -9
  55. package/lib/cjs/JsonSchema.js.map +1 -1
  56. package/lib/cjs/JsonUtils.d.ts +78 -78
  57. package/lib/cjs/JsonUtils.js +151 -151
  58. package/lib/cjs/JsonUtils.js.map +1 -1
  59. package/lib/cjs/LRUMap.d.ts +129 -129
  60. package/lib/cjs/LRUMap.js +333 -333
  61. package/lib/cjs/LRUMap.js.map +1 -1
  62. package/lib/cjs/Logger.d.ts +143 -143
  63. package/lib/cjs/Logger.d.ts.map +1 -1
  64. package/lib/cjs/Logger.js +256 -258
  65. package/lib/cjs/Logger.js.map +1 -1
  66. package/lib/cjs/ObservableSet.d.ts +23 -23
  67. package/lib/cjs/ObservableSet.js +51 -51
  68. package/lib/cjs/ObservableSet.js.map +1 -1
  69. package/lib/cjs/OneAtATimeAction.d.ts +31 -31
  70. package/lib/cjs/OneAtATimeAction.js +94 -94
  71. package/lib/cjs/OneAtATimeAction.js.map +1 -1
  72. package/lib/cjs/OrderedId64Iterable.d.ts +74 -74
  73. package/lib/cjs/OrderedId64Iterable.d.ts.map +1 -1
  74. package/lib/cjs/OrderedId64Iterable.js +235 -235
  75. package/lib/cjs/OrderedId64Iterable.js.map +1 -1
  76. package/lib/cjs/OrderedSet.d.ts +40 -40
  77. package/lib/cjs/OrderedSet.js +64 -64
  78. package/lib/cjs/OrderedSet.js.map +1 -1
  79. package/lib/cjs/PriorityQueue.d.ts +70 -70
  80. package/lib/cjs/PriorityQueue.d.ts.map +1 -1
  81. package/lib/cjs/PriorityQueue.js +140 -140
  82. package/lib/cjs/PriorityQueue.js.map +1 -1
  83. package/lib/cjs/ProcessDetector.d.ts +59 -59
  84. package/lib/cjs/ProcessDetector.js +71 -71
  85. package/lib/cjs/ProcessDetector.js.map +1 -1
  86. package/lib/cjs/SortedArray.d.ts +236 -232
  87. package/lib/cjs/SortedArray.d.ts.map +1 -1
  88. package/lib/cjs/SortedArray.js +315 -303
  89. package/lib/cjs/SortedArray.js.map +1 -1
  90. package/lib/cjs/StatusCategory.d.ts +30 -30
  91. package/lib/cjs/StatusCategory.d.ts.map +1 -1
  92. package/lib/cjs/StatusCategory.js +460 -460
  93. package/lib/cjs/StatusCategory.js.map +1 -1
  94. package/lib/cjs/StringUtils.d.ts +22 -22
  95. package/lib/cjs/StringUtils.js +148 -148
  96. package/lib/cjs/StringUtils.js.map +1 -1
  97. package/lib/cjs/Time.d.ts +122 -122
  98. package/lib/cjs/Time.js +152 -152
  99. package/lib/cjs/Time.js.map +1 -1
  100. package/lib/cjs/Tracing.d.ts +43 -40
  101. package/lib/cjs/Tracing.d.ts.map +1 -1
  102. package/lib/cjs/Tracing.js +134 -130
  103. package/lib/cjs/Tracing.js.map +1 -1
  104. package/lib/cjs/TupleKeyedMap.d.ts +36 -36
  105. package/lib/cjs/TupleKeyedMap.js +102 -102
  106. package/lib/cjs/TupleKeyedMap.js.map +1 -1
  107. package/lib/cjs/TypedArrayBuilder.d.ts +155 -155
  108. package/lib/cjs/TypedArrayBuilder.d.ts.map +1 -1
  109. package/lib/cjs/TypedArrayBuilder.js +206 -208
  110. package/lib/cjs/TypedArrayBuilder.js.map +1 -1
  111. package/lib/cjs/UnexpectedErrors.d.ts +43 -43
  112. package/lib/cjs/UnexpectedErrors.d.ts.map +1 -1
  113. package/lib/cjs/UnexpectedErrors.js +68 -68
  114. package/lib/cjs/UnexpectedErrors.js.map +1 -1
  115. package/lib/cjs/UtilityTypes.d.ts +112 -96
  116. package/lib/cjs/UtilityTypes.d.ts.map +1 -1
  117. package/lib/cjs/UtilityTypes.js +40 -40
  118. package/lib/cjs/UtilityTypes.js.map +1 -1
  119. package/lib/cjs/YieldManager.d.ts +18 -18
  120. package/lib/cjs/YieldManager.js +34 -34
  121. package/lib/cjs/YieldManager.js.map +1 -1
  122. package/lib/cjs/core-bentley.d.ts +74 -74
  123. package/lib/cjs/core-bentley.js +94 -90
  124. package/lib/cjs/core-bentley.js.map +1 -1
  125. package/lib/cjs/partitionArray.d.ts +21 -21
  126. package/lib/cjs/partitionArray.js +43 -43
  127. package/lib/cjs/partitionArray.js.map +1 -1
  128. package/lib/esm/AccessToken.d.ts +10 -10
  129. package/lib/esm/AccessToken.d.ts.map +1 -1
  130. package/lib/esm/AccessToken.js +8 -8
  131. package/lib/esm/AccessToken.js.map +1 -1
  132. package/lib/esm/Assert.d.ts +25 -25
  133. package/lib/esm/Assert.js +41 -41
  134. package/lib/esm/Assert.js.map +1 -1
  135. package/lib/esm/BeEvent.d.ts +81 -81
  136. package/lib/esm/BeEvent.d.ts.map +1 -1
  137. package/lib/esm/BeEvent.js +150 -150
  138. package/lib/esm/BeEvent.js.map +1 -1
  139. package/lib/esm/BeSQLite.d.ts +172 -170
  140. package/lib/esm/BeSQLite.d.ts.map +1 -1
  141. package/lib/esm/BeSQLite.js +182 -180
  142. package/lib/esm/BeSQLite.js.map +1 -1
  143. package/lib/esm/BentleyError.d.ts +378 -378
  144. package/lib/esm/BentleyError.d.ts.map +1 -1
  145. package/lib/esm/BentleyError.js +699 -698
  146. package/lib/esm/BentleyError.js.map +1 -1
  147. package/lib/esm/BentleyLoggerCategory.d.ts +11 -11
  148. package/lib/esm/BentleyLoggerCategory.js +16 -16
  149. package/lib/esm/BentleyLoggerCategory.js.map +1 -1
  150. package/lib/esm/ByteStream.d.ts +110 -110
  151. package/lib/esm/ByteStream.js +155 -155
  152. package/lib/esm/ByteStream.js.map +1 -1
  153. package/lib/esm/ClassUtils.d.ts +14 -14
  154. package/lib/esm/ClassUtils.js +22 -22
  155. package/lib/esm/ClassUtils.js.map +1 -1
  156. package/lib/esm/Compare.d.ts +47 -47
  157. package/lib/esm/Compare.d.ts.map +1 -1
  158. package/lib/esm/Compare.js +63 -63
  159. package/lib/esm/Compare.js.map +1 -1
  160. package/lib/esm/CompressedId64Set.d.ts +134 -134
  161. package/lib/esm/CompressedId64Set.d.ts.map +1 -1
  162. package/lib/esm/CompressedId64Set.js +423 -423
  163. package/lib/esm/CompressedId64Set.js.map +1 -1
  164. package/lib/esm/Dictionary.d.ts +125 -125
  165. package/lib/esm/Dictionary.js +199 -199
  166. package/lib/esm/Dictionary.js.map +1 -1
  167. package/lib/esm/Disposable.d.ts +80 -80
  168. package/lib/esm/Disposable.d.ts.map +1 -1
  169. package/lib/esm/Disposable.js +112 -112
  170. package/lib/esm/Disposable.js.map +1 -1
  171. package/lib/esm/Id.d.ts +285 -285
  172. package/lib/esm/Id.d.ts.map +1 -1
  173. package/lib/esm/Id.js +639 -639
  174. package/lib/esm/Id.js.map +1 -1
  175. package/lib/esm/IndexMap.d.ts +65 -65
  176. package/lib/esm/IndexMap.js +86 -86
  177. package/lib/esm/IndexMap.js.map +1 -1
  178. package/lib/esm/JsonSchema.d.ts +77 -77
  179. package/lib/esm/JsonSchema.d.ts.map +1 -1
  180. package/lib/esm/JsonSchema.js +8 -8
  181. package/lib/esm/JsonSchema.js.map +1 -1
  182. package/lib/esm/JsonUtils.d.ts +78 -78
  183. package/lib/esm/JsonUtils.js +148 -148
  184. package/lib/esm/JsonUtils.js.map +1 -1
  185. package/lib/esm/LRUMap.d.ts +129 -129
  186. package/lib/esm/LRUMap.js +326 -326
  187. package/lib/esm/LRUMap.js.map +1 -1
  188. package/lib/esm/Logger.d.ts +143 -143
  189. package/lib/esm/Logger.d.ts.map +1 -1
  190. package/lib/esm/Logger.js +253 -253
  191. package/lib/esm/Logger.js.map +1 -1
  192. package/lib/esm/ObservableSet.d.ts +23 -23
  193. package/lib/esm/ObservableSet.js +47 -47
  194. package/lib/esm/ObservableSet.js.map +1 -1
  195. package/lib/esm/OneAtATimeAction.d.ts +31 -31
  196. package/lib/esm/OneAtATimeAction.js +89 -89
  197. package/lib/esm/OneAtATimeAction.js.map +1 -1
  198. package/lib/esm/OrderedId64Iterable.d.ts +74 -74
  199. package/lib/esm/OrderedId64Iterable.d.ts.map +1 -1
  200. package/lib/esm/OrderedId64Iterable.js +232 -232
  201. package/lib/esm/OrderedId64Iterable.js.map +1 -1
  202. package/lib/esm/OrderedSet.d.ts +40 -40
  203. package/lib/esm/OrderedSet.js +59 -59
  204. package/lib/esm/OrderedSet.js.map +1 -1
  205. package/lib/esm/PriorityQueue.d.ts +70 -70
  206. package/lib/esm/PriorityQueue.d.ts.map +1 -1
  207. package/lib/esm/PriorityQueue.js +136 -136
  208. package/lib/esm/PriorityQueue.js.map +1 -1
  209. package/lib/esm/ProcessDetector.d.ts +59 -59
  210. package/lib/esm/ProcessDetector.js +67 -67
  211. package/lib/esm/ProcessDetector.js.map +1 -1
  212. package/lib/esm/SortedArray.d.ts +236 -232
  213. package/lib/esm/SortedArray.d.ts.map +1 -1
  214. package/lib/esm/SortedArray.js +308 -296
  215. package/lib/esm/SortedArray.js.map +1 -1
  216. package/lib/esm/StatusCategory.d.ts +30 -30
  217. package/lib/esm/StatusCategory.d.ts.map +1 -1
  218. package/lib/esm/StatusCategory.js +455 -454
  219. package/lib/esm/StatusCategory.js.map +1 -1
  220. package/lib/esm/StringUtils.d.ts +22 -22
  221. package/lib/esm/StringUtils.js +142 -142
  222. package/lib/esm/StringUtils.js.map +1 -1
  223. package/lib/esm/Time.d.ts +122 -122
  224. package/lib/esm/Time.js +146 -146
  225. package/lib/esm/Time.js.map +1 -1
  226. package/lib/esm/Tracing.d.ts +43 -40
  227. package/lib/esm/Tracing.d.ts.map +1 -1
  228. package/lib/esm/Tracing.js +130 -126
  229. package/lib/esm/Tracing.js.map +1 -1
  230. package/lib/esm/TupleKeyedMap.d.ts +36 -36
  231. package/lib/esm/TupleKeyedMap.js +98 -98
  232. package/lib/esm/TupleKeyedMap.js.map +1 -1
  233. package/lib/esm/TypedArrayBuilder.d.ts +155 -155
  234. package/lib/esm/TypedArrayBuilder.d.ts.map +1 -1
  235. package/lib/esm/TypedArrayBuilder.js +198 -200
  236. package/lib/esm/TypedArrayBuilder.js.map +1 -1
  237. package/lib/esm/UnexpectedErrors.d.ts +43 -43
  238. package/lib/esm/UnexpectedErrors.d.ts.map +1 -1
  239. package/lib/esm/UnexpectedErrors.js +65 -64
  240. package/lib/esm/UnexpectedErrors.js.map +1 -1
  241. package/lib/esm/UtilityTypes.d.ts +112 -96
  242. package/lib/esm/UtilityTypes.d.ts.map +1 -1
  243. package/lib/esm/UtilityTypes.js +34 -34
  244. package/lib/esm/UtilityTypes.js.map +1 -1
  245. package/lib/esm/YieldManager.d.ts +18 -18
  246. package/lib/esm/YieldManager.js +30 -30
  247. package/lib/esm/YieldManager.js.map +1 -1
  248. package/lib/esm/core-bentley.d.ts +74 -74
  249. package/lib/esm/core-bentley.js +78 -78
  250. package/lib/esm/core-bentley.js.map +1 -1
  251. package/lib/esm/partitionArray.d.ts +21 -21
  252. package/lib/esm/partitionArray.js +39 -39
  253. package/lib/esm/partitionArray.js.map +1 -1
  254. package/package.json +9 -9
@@ -1,15 +1,15 @@
1
- /** Check if class `subclass` is a different class from `superclass` but extends from `superclass`
2
- * @internal
3
- * @param subclass the class that may be a subclass of `superclass`
4
- * @param superclass the class that may be a base class of `subclass`
5
- * @returns whether `subclass` is a proper subclass of `superclass`
6
- */
7
- export declare function isProperSubclassOf<SuperClass extends new (..._: any[]) => any, NonSubClass extends new (..._: any[]) => any, SubClass extends new (..._: any[]) => InstanceType<SuperClass>>(subclass: SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass;
8
- /** Check if class `subclass` is `superclass` or extends from `superclass`
9
- * @internal
10
- * @param subclass the class that may be a subclass of `superclass`
11
- * @param superclass the class that may be a base class of `subclass`
12
- * @returns whether `subclass` is a subclass of `superclass`
13
- */
14
- export declare function isSubclassOf<SuperClass extends new (..._: any[]) => any, NonSubClass extends new (..._: any[]) => any, SubClass extends new (..._: any[]) => InstanceType<SuperClass>>(subclass: SuperClass | SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass | SuperClass;
1
+ /** Check if class `subclass` is a different class from `superclass` but extends from `superclass`
2
+ * @internal
3
+ * @param subclass the class that may be a subclass of `superclass`
4
+ * @param superclass the class that may be a base class of `subclass`
5
+ * @returns whether `subclass` is a proper subclass of `superclass`
6
+ */
7
+ export declare function isProperSubclassOf<SuperClass extends new (..._: any[]) => any, NonSubClass extends new (..._: any[]) => any, SubClass extends new (..._: any[]) => InstanceType<SuperClass>>(subclass: SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass;
8
+ /** Check if class `subclass` is `superclass` or extends from `superclass`
9
+ * @internal
10
+ * @param subclass the class that may be a subclass of `superclass`
11
+ * @param superclass the class that may be a base class of `subclass`
12
+ * @returns whether `subclass` is a subclass of `superclass`
13
+ */
14
+ export declare function isSubclassOf<SuperClass extends new (..._: any[]) => any, NonSubClass extends new (..._: any[]) => any, SubClass extends new (..._: any[]) => InstanceType<SuperClass>>(subclass: SuperClass | SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass | SuperClass;
15
15
  //# sourceMappingURL=ClassUtils.d.ts.map
@@ -1,28 +1,28 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isSubclassOf = exports.isProperSubclassOf = void 0;
8
- /** Check if class `subclass` is a different class from `superclass` but extends from `superclass`
9
- * @internal
10
- * @param subclass the class that may be a subclass of `superclass`
11
- * @param superclass the class that may be a base class of `subclass`
12
- * @returns whether `subclass` is a proper subclass of `superclass`
13
- */
14
- function isProperSubclassOf(subclass, superclass) {
15
- return subclass.prototype instanceof superclass;
16
- }
17
- exports.isProperSubclassOf = isProperSubclassOf;
18
- /** Check if class `subclass` is `superclass` or extends from `superclass`
19
- * @internal
20
- * @param subclass the class that may be a subclass of `superclass`
21
- * @param superclass the class that may be a base class of `subclass`
22
- * @returns whether `subclass` is a subclass of `superclass`
23
- */
24
- function isSubclassOf(subclass, superclass) {
25
- return subclass === superclass || isProperSubclassOf(subclass, superclass);
26
- }
27
- exports.isSubclassOf = isSubclassOf;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.isSubclassOf = exports.isProperSubclassOf = void 0;
8
+ /** Check if class `subclass` is a different class from `superclass` but extends from `superclass`
9
+ * @internal
10
+ * @param subclass the class that may be a subclass of `superclass`
11
+ * @param superclass the class that may be a base class of `subclass`
12
+ * @returns whether `subclass` is a proper subclass of `superclass`
13
+ */
14
+ function isProperSubclassOf(subclass, superclass) {
15
+ return subclass.prototype instanceof superclass;
16
+ }
17
+ exports.isProperSubclassOf = isProperSubclassOf;
18
+ /** Check if class `subclass` is `superclass` or extends from `superclass`
19
+ * @internal
20
+ * @param subclass the class that may be a subclass of `superclass`
21
+ * @param superclass the class that may be a base class of `subclass`
22
+ * @returns whether `subclass` is a subclass of `superclass`
23
+ */
24
+ function isSubclassOf(subclass, superclass) {
25
+ return subclass === superclass || isProperSubclassOf(subclass, superclass);
26
+ }
27
+ exports.isSubclassOf = isSubclassOf;
28
28
  //# sourceMappingURL=ClassUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClassUtils.js","sourceRoot":"","sources":["../../src/ClassUtils.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;;;;GAKG;AACH,SAAgB,kBAAkB,CAIhC,QAAgC,EAAE,UAAsB;IACxD,OAAO,QAAQ,CAAC,SAAS,YAAY,UAAU,CAAC;AAClD,CAAC;AAND,gDAMC;AAED;;;;;GAKG;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\r\n/** Check if class `subclass` is a different class from `superclass` but extends from `superclass`\r\n * @internal\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 * @returns whether `subclass` is a proper subclass of `superclass`\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 * @internal\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 * @returns whether `subclass` is a subclass of `superclass`\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;;;AAE/F;;;;;GAKG;AACH,SAAgB,kBAAkB,CAIhC,QAAgC,EAAE,UAAsB;IACxD,OAAO,QAAQ,CAAC,SAAS,YAAY,UAAU,CAAC;AAClD,CAAC;AAND,gDAMC;AAED;;;;;GAKG;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":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** Check if class `subclass` is a different class from `superclass` but extends from `superclass`\n * @internal\n * @param subclass the class that may be a subclass of `superclass`\n * @param superclass the class that may be a base class of `subclass`\n * @returns whether `subclass` is a proper subclass of `superclass`\n */\nexport function isProperSubclassOf<\n SuperClass extends new (..._: any[]) => any,\n NonSubClass extends new (..._: any[]) => any,\n SubClass extends new (..._: any[]) => InstanceType<SuperClass>,\n>(subclass: SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass {\n return subclass.prototype instanceof superclass;\n}\n\n/** Check if class `subclass` is `superclass` or extends from `superclass`\n * @internal\n * @param subclass the class that may be a subclass of `superclass`\n * @param superclass the class that may be a base class of `subclass`\n * @returns whether `subclass` is a subclass of `superclass`\n */\nexport function isSubclassOf<\n SuperClass extends new (..._: any[]) => any,\n NonSubClass extends new (..._: any[]) => any,\n SubClass extends new (..._: any[]) => InstanceType<SuperClass>,\n>(subclass: SuperClass | SubClass | NonSubClass, superclass: SuperClass): subclass is SubClass | SuperClass {\n return subclass === superclass || isProperSubclassOf(subclass, superclass);\n}\n"]}
@@ -1,48 +1,48 @@
1
- /** @packageDocumentation
2
- * @module Utils
3
- */
4
- /**
5
- * A function that returns a numerical value indicating how two objects are ordered in relation to one another.
6
- * Such functions are used by various collection classes throughout the library.
7
- * Given values `lhs` and `rhs`, the function returns:
8
- * - Zero if lhs == rhs
9
- * - A negative number if lhs < rhs
10
- * - A positive number if lhs > rhs
11
- *
12
- * 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:
13
- * - `compare(x, x)` returns zero.
14
- * - If `compare(x, y)` returns zero, then so does `compare(y, x)` (i.e., `x == y` implies `y == x`).
15
- * - 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`).
16
- * - 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`).
17
- *
18
- * @see SortedArray
19
- * @see Dictionary
20
- * @see IndexMap
21
- * @see PriorityQueue
22
- * @public
23
- */
24
- export declare type OrderedComparator<T, U = T> = (lhs: T, rhs: U) => number;
25
- /**
26
- * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.
27
- * @public
28
- */
29
- export declare function compareWithTolerance(a: number, b: number, tolerance?: number): number;
30
- /** @public */
31
- export declare function compareNumbers(a: number, b: number): number;
32
- /** @public */
33
- export declare function compareBooleans(a: boolean, b: boolean): number;
34
- /** @public */
35
- export declare function compareStrings(a: string, b: string): number;
36
- /** @public */
37
- export declare function comparePossiblyUndefined<T>(compareDefined: (lhs: T, rhs: T) => number, lhs?: T, rhs?: T): number;
38
- /** @public */
39
- export declare function compareStringsOrUndefined(lhs?: string, rhs?: string): number;
40
- /** @public */
41
- export declare function compareNumbersOrUndefined(lhs?: number, rhs?: number): number;
42
- /** @public */
43
- export declare function compareBooleansOrUndefined(lhs?: boolean, rhs?: boolean): number;
44
- /** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.
45
- * @public
46
- */
47
- export declare function areEqualPossiblyUndefined<T, U>(t: T | undefined, u: U | undefined, areEqual: (t: T, u: U) => boolean): boolean;
1
+ /** @packageDocumentation
2
+ * @module Utils
3
+ */
4
+ /**
5
+ * A function that returns a numerical value indicating how two objects are ordered in relation to one another.
6
+ * Such functions are used by various collection classes throughout the library.
7
+ * Given values `lhs` and `rhs`, the function returns:
8
+ * - Zero if lhs == rhs
9
+ * - A negative number if lhs < rhs
10
+ * - A positive number if lhs > rhs
11
+ *
12
+ * 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:
13
+ * - `compare(x, x)` returns zero.
14
+ * - If `compare(x, y)` returns zero, then so does `compare(y, x)` (i.e., `x == y` implies `y == x`).
15
+ * - 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`).
16
+ * - 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`).
17
+ *
18
+ * @see SortedArray
19
+ * @see Dictionary
20
+ * @see IndexMap
21
+ * @see PriorityQueue
22
+ * @public
23
+ */
24
+ export type OrderedComparator<T, U = T> = (lhs: T, rhs: U) => number;
25
+ /**
26
+ * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.
27
+ * @public
28
+ */
29
+ export declare function compareWithTolerance(a: number, b: number, tolerance?: number): number;
30
+ /** @public */
31
+ export declare function compareNumbers(a: number, b: number): number;
32
+ /** @public */
33
+ export declare function compareBooleans(a: boolean, b: boolean): number;
34
+ /** @public */
35
+ export declare function compareStrings(a: string, b: string): number;
36
+ /** @public */
37
+ export declare function comparePossiblyUndefined<T>(compareDefined: (lhs: T, rhs: T) => number, lhs?: T, rhs?: T): number;
38
+ /** @public */
39
+ export declare function compareStringsOrUndefined(lhs?: string, rhs?: string): number;
40
+ /** @public */
41
+ export declare function compareNumbersOrUndefined(lhs?: number, rhs?: number): number;
42
+ /** @public */
43
+ export declare function compareBooleansOrUndefined(lhs?: boolean, rhs?: boolean): number;
44
+ /** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.
45
+ * @public
46
+ */
47
+ export declare function areEqualPossiblyUndefined<T, U>(t: T | undefined, u: U | undefined, areEqual: (t: T, u: U) => boolean): boolean;
48
48
  //# sourceMappingURL=Compare.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Compare.d.ts","sourceRoot":"","sources":["../../src/Compare.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,oBAAY,iBAAiB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC;AAErE;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAOlF;AAED,cAAc;AACd,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,cAAc;AACd,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAE9D;AAED,cAAc;AACd,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,cAAc;AACd,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,EAAE,CAAC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,GAAG,MAAM,CAE9D;AAED,cAAc;AACd,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,cAAc;AACd,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAOhH;AAED,cAAc;AACd,wBAAgB,yBAAyB,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,cAAc;AACd,wBAAgB,yBAAyB,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,cAAc;AACd,wBAAgB,0BAA0B,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,CAE/E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAO9H"}
@@ -1,76 +1,76 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Utils
8
- */
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;
11
- /**
12
- * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.
13
- * @public
14
- */
15
- function compareWithTolerance(a, b, tolerance = 0.1) {
16
- if (a < b - tolerance)
17
- return -1;
18
- else if (a > b + tolerance)
19
- return 1;
20
- else
21
- return 0;
22
- }
23
- exports.compareWithTolerance = compareWithTolerance;
24
- /** @public */
25
- function compareNumbers(a, b) {
26
- return a - b;
27
- }
28
- exports.compareNumbers = compareNumbers;
29
- /** @public */
30
- function compareBooleans(a, b) {
31
- return a !== b ? (a < b ? -1 : 1) : 0;
32
- }
33
- exports.compareBooleans = compareBooleans;
34
- /** @public */
35
- function compareStrings(a, b) {
36
- return a === b ? 0 : (a < b ? -1 : 1);
37
- }
38
- exports.compareStrings = compareStrings;
39
- /** @public */
40
- function comparePossiblyUndefined(compareDefined, lhs, rhs) {
41
- if (undefined === lhs)
42
- return undefined === rhs ? 0 : -1;
43
- else if (undefined === rhs)
44
- return 1;
45
- else
46
- return compareDefined(lhs, rhs);
47
- }
48
- exports.comparePossiblyUndefined = comparePossiblyUndefined;
49
- /** @public */
50
- function compareStringsOrUndefined(lhs, rhs) {
51
- return comparePossiblyUndefined(compareStrings, lhs, rhs);
52
- }
53
- exports.compareStringsOrUndefined = compareStringsOrUndefined;
54
- /** @public */
55
- function compareNumbersOrUndefined(lhs, rhs) {
56
- return comparePossiblyUndefined(compareNumbers, lhs, rhs);
57
- }
58
- exports.compareNumbersOrUndefined = compareNumbersOrUndefined;
59
- /** @public */
60
- function compareBooleansOrUndefined(lhs, rhs) {
61
- return comparePossiblyUndefined(compareBooleans, lhs, rhs);
62
- }
63
- exports.compareBooleansOrUndefined = compareBooleansOrUndefined;
64
- /** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.
65
- * @public
66
- */
67
- function areEqualPossiblyUndefined(t, u, areEqual) {
68
- if (undefined === t)
69
- return undefined === u;
70
- else if (undefined === u)
71
- return false;
72
- else
73
- return areEqual(t, u);
74
- }
75
- exports.areEqualPossiblyUndefined = areEqualPossiblyUndefined;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Utils
8
+ */
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;
11
+ /**
12
+ * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.
13
+ * @public
14
+ */
15
+ function compareWithTolerance(a, b, tolerance = 0.1) {
16
+ if (a < b - tolerance)
17
+ return -1;
18
+ else if (a > b + tolerance)
19
+ return 1;
20
+ else
21
+ return 0;
22
+ }
23
+ exports.compareWithTolerance = compareWithTolerance;
24
+ /** @public */
25
+ function compareNumbers(a, b) {
26
+ return a - b;
27
+ }
28
+ exports.compareNumbers = compareNumbers;
29
+ /** @public */
30
+ function compareBooleans(a, b) {
31
+ return a !== b ? (a < b ? -1 : 1) : 0;
32
+ }
33
+ exports.compareBooleans = compareBooleans;
34
+ /** @public */
35
+ function compareStrings(a, b) {
36
+ return a === b ? 0 : (a < b ? -1 : 1);
37
+ }
38
+ exports.compareStrings = compareStrings;
39
+ /** @public */
40
+ function comparePossiblyUndefined(compareDefined, lhs, rhs) {
41
+ if (undefined === lhs)
42
+ return undefined === rhs ? 0 : -1;
43
+ else if (undefined === rhs)
44
+ return 1;
45
+ else
46
+ return compareDefined(lhs, rhs);
47
+ }
48
+ exports.comparePossiblyUndefined = comparePossiblyUndefined;
49
+ /** @public */
50
+ function compareStringsOrUndefined(lhs, rhs) {
51
+ return comparePossiblyUndefined(compareStrings, lhs, rhs);
52
+ }
53
+ exports.compareStringsOrUndefined = compareStringsOrUndefined;
54
+ /** @public */
55
+ function compareNumbersOrUndefined(lhs, rhs) {
56
+ return comparePossiblyUndefined(compareNumbers, lhs, rhs);
57
+ }
58
+ exports.compareNumbersOrUndefined = compareNumbersOrUndefined;
59
+ /** @public */
60
+ function compareBooleansOrUndefined(lhs, rhs) {
61
+ return comparePossiblyUndefined(compareBooleans, lhs, rhs);
62
+ }
63
+ exports.compareBooleansOrUndefined = compareBooleansOrUndefined;
64
+ /** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.
65
+ * @public
66
+ */
67
+ function areEqualPossiblyUndefined(t, u, areEqual) {
68
+ if (undefined === t)
69
+ return undefined === u;
70
+ else if (undefined === u)
71
+ return false;
72
+ else
73
+ return areEqual(t, u);
74
+ }
75
+ exports.areEqualPossiblyUndefined = areEqualPossiblyUndefined;
76
76
  //# 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,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,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,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;;;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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;IAClE,OAAO,wBAAwB,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC;AAFD,8DAEC;AAED,cAAc;AACd,SAAgB,0BAA0B,CAAC,GAAa,EAAE,GAAa;IACrE,OAAO,wBAAwB,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC7D,CAAC;AAFD,gEAEC;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;AAPD,8DAOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\n/**\n * A function that returns a numerical value indicating how two objects are ordered in relation to one another.\n * Such functions are used by various collection classes throughout the library.\n * Given values `lhs` and `rhs`, the function returns:\n * - Zero if lhs == rhs\n * - A negative number if lhs < rhs\n * - A positive number if lhs > rhs\n *\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:\n * - `compare(x, x)` returns zero.\n * - If `compare(x, y)` returns zero, then so does `compare(y, x)` (i.e., `x == y` implies `y == x`).\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`).\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`).\n *\n * @see SortedArray\n * @see Dictionary\n * @see IndexMap\n * @see PriorityQueue\n * @public\n */\nexport type OrderedComparator<T, U = T> = (lhs: T, rhs: U) => number;\n\n/**\n * An [[OrderedComparator]] for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance.\n * @public\n */\nexport function compareWithTolerance(a: number, b: number, tolerance = 0.1): number {\n if (a < b - tolerance)\n return -1;\n else if (a > b + tolerance)\n return 1;\n else\n return 0;\n}\n\n/** @public */\nexport function compareNumbers(a: number, b: number): number {\n return a - b;\n}\n\n/** @public */\nexport function compareBooleans(a: boolean, b: boolean): number {\n return a !== b ? (a < b ? -1 : 1) : 0;\n}\n\n/** @public */\nexport function compareStrings(a: string, b: string): number {\n return a === b ? 0 : (a < b ? -1 : 1);\n}\n\n/** @public */\nexport function comparePossiblyUndefined<T>(compareDefined: (lhs: T, rhs: T) => number, lhs?: T, rhs?: T): number {\n if (undefined === lhs)\n return undefined === rhs ? 0 : -1;\n else if (undefined === rhs)\n return 1;\n else\n return compareDefined(lhs, rhs);\n}\n\n/** @public */\nexport function compareStringsOrUndefined(lhs?: string, rhs?: string): number {\n return comparePossiblyUndefined(compareStrings, lhs, rhs);\n}\n\n/** @public */\nexport function compareNumbersOrUndefined(lhs?: number, rhs?: number): number {\n return comparePossiblyUndefined(compareNumbers, lhs, rhs);\n}\n\n/** @public */\nexport function compareBooleansOrUndefined(lhs?: boolean, rhs?: boolean): number {\n return comparePossiblyUndefined(compareBooleans, lhs, rhs);\n}\n\n/** Compare two possibly-undefined values for equality. If both are undefined, the comparison is performed by the supplied `areEqual` function.\n * @public\n */\nexport function areEqualPossiblyUndefined<T, U>(t: T | undefined, u: U | undefined, areEqual: (t: T, u: U) => boolean): boolean {\n if (undefined === t)\n return undefined === u;\n else if (undefined === u)\n return false;\n else\n return areEqual(t, u);\n}\n"]}