@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.
- package/CHANGELOG.md +50 -1
- package/lib/cjs/AccessToken.d.ts +10 -10
- package/lib/cjs/AccessToken.d.ts.map +1 -1
- package/lib/cjs/AccessToken.js +9 -9
- package/lib/cjs/AccessToken.js.map +1 -1
- package/lib/cjs/Assert.d.ts +25 -25
- package/lib/cjs/Assert.js +45 -45
- package/lib/cjs/Assert.js.map +1 -1
- package/lib/cjs/BeEvent.d.ts +81 -81
- package/lib/cjs/BeEvent.d.ts.map +1 -1
- package/lib/cjs/BeEvent.js +156 -156
- package/lib/cjs/BeEvent.js.map +1 -1
- package/lib/cjs/BeSQLite.d.ts +172 -170
- package/lib/cjs/BeSQLite.d.ts.map +1 -1
- package/lib/cjs/BeSQLite.js +185 -183
- package/lib/cjs/BeSQLite.js.map +1 -1
- package/lib/cjs/BentleyError.d.ts +378 -378
- package/lib/cjs/BentleyError.d.ts.map +1 -1
- package/lib/cjs/BentleyError.js +703 -702
- package/lib/cjs/BentleyError.js.map +1 -1
- package/lib/cjs/BentleyLoggerCategory.d.ts +11 -11
- package/lib/cjs/BentleyLoggerCategory.js +19 -19
- package/lib/cjs/BentleyLoggerCategory.js.map +1 -1
- package/lib/cjs/ByteStream.d.ts +110 -110
- package/lib/cjs/ByteStream.js +159 -159
- package/lib/cjs/ByteStream.js.map +1 -1
- package/lib/cjs/ClassUtils.d.ts +14 -14
- package/lib/cjs/ClassUtils.js +27 -27
- package/lib/cjs/ClassUtils.js.map +1 -1
- package/lib/cjs/Compare.d.ts +47 -47
- package/lib/cjs/Compare.d.ts.map +1 -1
- package/lib/cjs/Compare.js +75 -75
- package/lib/cjs/Compare.js.map +1 -1
- package/lib/cjs/CompressedId64Set.d.ts +134 -134
- package/lib/cjs/CompressedId64Set.d.ts.map +1 -1
- package/lib/cjs/CompressedId64Set.js +428 -428
- package/lib/cjs/CompressedId64Set.js.map +1 -1
- package/lib/cjs/Dictionary.d.ts +125 -125
- package/lib/cjs/Dictionary.js +203 -203
- package/lib/cjs/Dictionary.js.map +1 -1
- package/lib/cjs/Disposable.d.ts +80 -80
- package/lib/cjs/Disposable.d.ts.map +1 -1
- package/lib/cjs/Disposable.js +120 -120
- package/lib/cjs/Disposable.js.map +1 -1
- package/lib/cjs/Id.d.ts +285 -285
- package/lib/cjs/Id.d.ts.map +1 -1
- package/lib/cjs/Id.js +643 -643
- package/lib/cjs/Id.js.map +1 -1
- package/lib/cjs/IndexMap.d.ts +65 -65
- package/lib/cjs/IndexMap.js +91 -91
- package/lib/cjs/IndexMap.js.map +1 -1
- package/lib/cjs/JsonSchema.d.ts +77 -77
- package/lib/cjs/JsonSchema.d.ts.map +1 -1
- package/lib/cjs/JsonSchema.js +9 -9
- package/lib/cjs/JsonSchema.js.map +1 -1
- package/lib/cjs/JsonUtils.d.ts +78 -78
- package/lib/cjs/JsonUtils.js +151 -151
- package/lib/cjs/JsonUtils.js.map +1 -1
- package/lib/cjs/LRUMap.d.ts +129 -129
- package/lib/cjs/LRUMap.js +333 -333
- package/lib/cjs/LRUMap.js.map +1 -1
- package/lib/cjs/Logger.d.ts +143 -143
- package/lib/cjs/Logger.d.ts.map +1 -1
- package/lib/cjs/Logger.js +256 -258
- package/lib/cjs/Logger.js.map +1 -1
- package/lib/cjs/ObservableSet.d.ts +23 -23
- package/lib/cjs/ObservableSet.js +51 -51
- package/lib/cjs/ObservableSet.js.map +1 -1
- package/lib/cjs/OneAtATimeAction.d.ts +31 -31
- package/lib/cjs/OneAtATimeAction.js +94 -94
- package/lib/cjs/OneAtATimeAction.js.map +1 -1
- package/lib/cjs/OrderedId64Iterable.d.ts +74 -74
- package/lib/cjs/OrderedId64Iterable.d.ts.map +1 -1
- package/lib/cjs/OrderedId64Iterable.js +235 -235
- package/lib/cjs/OrderedId64Iterable.js.map +1 -1
- package/lib/cjs/OrderedSet.d.ts +40 -40
- package/lib/cjs/OrderedSet.js +64 -64
- package/lib/cjs/OrderedSet.js.map +1 -1
- package/lib/cjs/PriorityQueue.d.ts +70 -70
- package/lib/cjs/PriorityQueue.d.ts.map +1 -1
- package/lib/cjs/PriorityQueue.js +140 -140
- package/lib/cjs/PriorityQueue.js.map +1 -1
- package/lib/cjs/ProcessDetector.d.ts +59 -59
- package/lib/cjs/ProcessDetector.js +71 -71
- package/lib/cjs/ProcessDetector.js.map +1 -1
- package/lib/cjs/SortedArray.d.ts +236 -232
- package/lib/cjs/SortedArray.d.ts.map +1 -1
- package/lib/cjs/SortedArray.js +315 -303
- package/lib/cjs/SortedArray.js.map +1 -1
- package/lib/cjs/StatusCategory.d.ts +30 -30
- package/lib/cjs/StatusCategory.d.ts.map +1 -1
- package/lib/cjs/StatusCategory.js +460 -460
- package/lib/cjs/StatusCategory.js.map +1 -1
- package/lib/cjs/StringUtils.d.ts +22 -22
- package/lib/cjs/StringUtils.js +148 -148
- package/lib/cjs/StringUtils.js.map +1 -1
- package/lib/cjs/Time.d.ts +122 -122
- package/lib/cjs/Time.js +152 -152
- package/lib/cjs/Time.js.map +1 -1
- package/lib/cjs/Tracing.d.ts +43 -40
- package/lib/cjs/Tracing.d.ts.map +1 -1
- package/lib/cjs/Tracing.js +134 -130
- package/lib/cjs/Tracing.js.map +1 -1
- package/lib/cjs/TupleKeyedMap.d.ts +36 -36
- package/lib/cjs/TupleKeyedMap.js +102 -102
- package/lib/cjs/TupleKeyedMap.js.map +1 -1
- package/lib/cjs/TypedArrayBuilder.d.ts +155 -155
- package/lib/cjs/TypedArrayBuilder.d.ts.map +1 -1
- package/lib/cjs/TypedArrayBuilder.js +206 -208
- package/lib/cjs/TypedArrayBuilder.js.map +1 -1
- package/lib/cjs/UnexpectedErrors.d.ts +43 -43
- package/lib/cjs/UnexpectedErrors.d.ts.map +1 -1
- package/lib/cjs/UnexpectedErrors.js +68 -68
- package/lib/cjs/UnexpectedErrors.js.map +1 -1
- package/lib/cjs/UtilityTypes.d.ts +112 -96
- package/lib/cjs/UtilityTypes.d.ts.map +1 -1
- package/lib/cjs/UtilityTypes.js +40 -40
- package/lib/cjs/UtilityTypes.js.map +1 -1
- package/lib/cjs/YieldManager.d.ts +18 -18
- package/lib/cjs/YieldManager.js +34 -34
- package/lib/cjs/YieldManager.js.map +1 -1
- package/lib/cjs/core-bentley.d.ts +74 -74
- package/lib/cjs/core-bentley.js +94 -90
- package/lib/cjs/core-bentley.js.map +1 -1
- package/lib/cjs/partitionArray.d.ts +21 -21
- package/lib/cjs/partitionArray.js +43 -43
- package/lib/cjs/partitionArray.js.map +1 -1
- package/lib/esm/AccessToken.d.ts +10 -10
- package/lib/esm/AccessToken.d.ts.map +1 -1
- package/lib/esm/AccessToken.js +8 -8
- package/lib/esm/AccessToken.js.map +1 -1
- package/lib/esm/Assert.d.ts +25 -25
- package/lib/esm/Assert.js +41 -41
- package/lib/esm/Assert.js.map +1 -1
- package/lib/esm/BeEvent.d.ts +81 -81
- package/lib/esm/BeEvent.d.ts.map +1 -1
- package/lib/esm/BeEvent.js +150 -150
- package/lib/esm/BeEvent.js.map +1 -1
- package/lib/esm/BeSQLite.d.ts +172 -170
- package/lib/esm/BeSQLite.d.ts.map +1 -1
- package/lib/esm/BeSQLite.js +182 -180
- package/lib/esm/BeSQLite.js.map +1 -1
- package/lib/esm/BentleyError.d.ts +378 -378
- package/lib/esm/BentleyError.d.ts.map +1 -1
- package/lib/esm/BentleyError.js +699 -698
- package/lib/esm/BentleyError.js.map +1 -1
- package/lib/esm/BentleyLoggerCategory.d.ts +11 -11
- package/lib/esm/BentleyLoggerCategory.js +16 -16
- package/lib/esm/BentleyLoggerCategory.js.map +1 -1
- package/lib/esm/ByteStream.d.ts +110 -110
- package/lib/esm/ByteStream.js +155 -155
- package/lib/esm/ByteStream.js.map +1 -1
- package/lib/esm/ClassUtils.d.ts +14 -14
- package/lib/esm/ClassUtils.js +22 -22
- package/lib/esm/ClassUtils.js.map +1 -1
- package/lib/esm/Compare.d.ts +47 -47
- package/lib/esm/Compare.d.ts.map +1 -1
- package/lib/esm/Compare.js +63 -63
- package/lib/esm/Compare.js.map +1 -1
- package/lib/esm/CompressedId64Set.d.ts +134 -134
- package/lib/esm/CompressedId64Set.d.ts.map +1 -1
- package/lib/esm/CompressedId64Set.js +423 -423
- package/lib/esm/CompressedId64Set.js.map +1 -1
- package/lib/esm/Dictionary.d.ts +125 -125
- package/lib/esm/Dictionary.js +199 -199
- package/lib/esm/Dictionary.js.map +1 -1
- package/lib/esm/Disposable.d.ts +80 -80
- package/lib/esm/Disposable.d.ts.map +1 -1
- package/lib/esm/Disposable.js +112 -112
- package/lib/esm/Disposable.js.map +1 -1
- package/lib/esm/Id.d.ts +285 -285
- package/lib/esm/Id.d.ts.map +1 -1
- package/lib/esm/Id.js +639 -639
- package/lib/esm/Id.js.map +1 -1
- package/lib/esm/IndexMap.d.ts +65 -65
- package/lib/esm/IndexMap.js +86 -86
- package/lib/esm/IndexMap.js.map +1 -1
- package/lib/esm/JsonSchema.d.ts +77 -77
- package/lib/esm/JsonSchema.d.ts.map +1 -1
- package/lib/esm/JsonSchema.js +8 -8
- package/lib/esm/JsonSchema.js.map +1 -1
- package/lib/esm/JsonUtils.d.ts +78 -78
- package/lib/esm/JsonUtils.js +148 -148
- package/lib/esm/JsonUtils.js.map +1 -1
- package/lib/esm/LRUMap.d.ts +129 -129
- package/lib/esm/LRUMap.js +326 -326
- package/lib/esm/LRUMap.js.map +1 -1
- package/lib/esm/Logger.d.ts +143 -143
- package/lib/esm/Logger.d.ts.map +1 -1
- package/lib/esm/Logger.js +253 -253
- package/lib/esm/Logger.js.map +1 -1
- package/lib/esm/ObservableSet.d.ts +23 -23
- package/lib/esm/ObservableSet.js +47 -47
- package/lib/esm/ObservableSet.js.map +1 -1
- package/lib/esm/OneAtATimeAction.d.ts +31 -31
- package/lib/esm/OneAtATimeAction.js +89 -89
- package/lib/esm/OneAtATimeAction.js.map +1 -1
- package/lib/esm/OrderedId64Iterable.d.ts +74 -74
- package/lib/esm/OrderedId64Iterable.d.ts.map +1 -1
- package/lib/esm/OrderedId64Iterable.js +232 -232
- package/lib/esm/OrderedId64Iterable.js.map +1 -1
- package/lib/esm/OrderedSet.d.ts +40 -40
- package/lib/esm/OrderedSet.js +59 -59
- package/lib/esm/OrderedSet.js.map +1 -1
- package/lib/esm/PriorityQueue.d.ts +70 -70
- package/lib/esm/PriorityQueue.d.ts.map +1 -1
- package/lib/esm/PriorityQueue.js +136 -136
- package/lib/esm/PriorityQueue.js.map +1 -1
- package/lib/esm/ProcessDetector.d.ts +59 -59
- package/lib/esm/ProcessDetector.js +67 -67
- package/lib/esm/ProcessDetector.js.map +1 -1
- package/lib/esm/SortedArray.d.ts +236 -232
- package/lib/esm/SortedArray.d.ts.map +1 -1
- package/lib/esm/SortedArray.js +308 -296
- package/lib/esm/SortedArray.js.map +1 -1
- package/lib/esm/StatusCategory.d.ts +30 -30
- package/lib/esm/StatusCategory.d.ts.map +1 -1
- package/lib/esm/StatusCategory.js +455 -454
- package/lib/esm/StatusCategory.js.map +1 -1
- package/lib/esm/StringUtils.d.ts +22 -22
- package/lib/esm/StringUtils.js +142 -142
- package/lib/esm/StringUtils.js.map +1 -1
- package/lib/esm/Time.d.ts +122 -122
- package/lib/esm/Time.js +146 -146
- package/lib/esm/Time.js.map +1 -1
- package/lib/esm/Tracing.d.ts +43 -40
- package/lib/esm/Tracing.d.ts.map +1 -1
- package/lib/esm/Tracing.js +130 -126
- package/lib/esm/Tracing.js.map +1 -1
- package/lib/esm/TupleKeyedMap.d.ts +36 -36
- package/lib/esm/TupleKeyedMap.js +98 -98
- package/lib/esm/TupleKeyedMap.js.map +1 -1
- package/lib/esm/TypedArrayBuilder.d.ts +155 -155
- package/lib/esm/TypedArrayBuilder.d.ts.map +1 -1
- package/lib/esm/TypedArrayBuilder.js +198 -200
- package/lib/esm/TypedArrayBuilder.js.map +1 -1
- package/lib/esm/UnexpectedErrors.d.ts +43 -43
- package/lib/esm/UnexpectedErrors.d.ts.map +1 -1
- package/lib/esm/UnexpectedErrors.js +65 -64
- package/lib/esm/UnexpectedErrors.js.map +1 -1
- package/lib/esm/UtilityTypes.d.ts +112 -96
- package/lib/esm/UtilityTypes.d.ts.map +1 -1
- package/lib/esm/UtilityTypes.js +34 -34
- package/lib/esm/UtilityTypes.js.map +1 -1
- package/lib/esm/YieldManager.d.ts +18 -18
- package/lib/esm/YieldManager.js +30 -30
- package/lib/esm/YieldManager.js.map +1 -1
- package/lib/esm/core-bentley.d.ts +74 -74
- package/lib/esm/core-bentley.js +78 -78
- package/lib/esm/core-bentley.js.map +1 -1
- package/lib/esm/partitionArray.d.ts +21 -21
- package/lib/esm/partitionArray.js +39 -39
- package/lib/esm/partitionArray.js.map +1 -1
- package/package.json +9 -9
package/lib/cjs/ClassUtils.d.ts
CHANGED
|
@@ -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
|
package/lib/cjs/ClassUtils.js
CHANGED
|
@@ -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":["/*---------------------------------------------------------------------------------------------\
|
|
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"]}
|
package/lib/cjs/Compare.d.ts
CHANGED
|
@@ -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
|
|
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
|
package/lib/cjs/Compare.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Compare.d.ts","sourceRoot":"","sources":["../../src/Compare.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,
|
|
1
|
+
{"version":3,"file":"Compare.d.ts","sourceRoot":"","sources":["../../src/Compare.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,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,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"}
|
package/lib/cjs/Compare.js
CHANGED
|
@@ -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
|
package/lib/cjs/Compare.js.map
CHANGED
|
@@ -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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,0CAEC;AAED,cAAc;AACd,SAAgB,cAAc,CAAC,CAAS,EAAE,CAAS;IACjD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,wCAEC;AAED,cAAc;AACd,SAAgB,wBAAwB,CAAI,cAA0C,EAAE,GAAO,EAAE,GAAO;IACtG,IAAI,SAAS,KAAK,GAAG;QACnB,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/B,IAAI,SAAS,KAAK,GAAG;QACxB,OAAO,CAAC,CAAC;;QAET,OAAO,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAPD,4DAOC;AAED,cAAc;AACd,SAAgB,yBAAyB,CAAC,GAAY,EAAE,GAAY;IAClE,OAAO,wBAAwB,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC;AAFD,8DAEC;AAED,cAAc;AACd,SAAgB,yBAAyB,CAAC,GAAY,EAAE,GAAY;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":["/*---------------------------------------------------------------------------------------------\
|
|
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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,0CAEC;AAED,cAAc;AACd,SAAgB,cAAc,CAAC,CAAS,EAAE,CAAS;IACjD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAFD,wCAEC;AAED,cAAc;AACd,SAAgB,wBAAwB,CAAI,cAA0C,EAAE,GAAO,EAAE,GAAO;IACtG,IAAI,SAAS,KAAK,GAAG;QACnB,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/B,IAAI,SAAS,KAAK,GAAG;QACxB,OAAO,CAAC,CAAC;;QAET,OAAO,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAPD,4DAOC;AAED,cAAc;AACd,SAAgB,yBAAyB,CAAC,GAAY,EAAE,GAAY;IAClE,OAAO,wBAAwB,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC;AAFD,8DAEC;AAED,cAAc;AACd,SAAgB,yBAAyB,CAAC,GAAY,EAAE,GAAY;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"]}
|