@itwin/core-quantity 4.0.0-dev.52 → 4.0.0-dev.54
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/lib/cjs/Constants.d.ts +27 -27
- package/lib/cjs/Constants.js +52 -52
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Exception.d.ts +26 -26
- package/lib/cjs/Exception.js +38 -38
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Formatter/Format.d.ts +91 -91
- package/lib/cjs/Formatter/Format.js +328 -328
- package/lib/cjs/Formatter/Format.js.map +1 -1
- package/lib/cjs/Formatter/FormatEnums.d.ts +133 -133
- package/lib/cjs/Formatter/FormatEnums.js +318 -318
- package/lib/cjs/Formatter/FormatEnums.js.map +1 -1
- package/lib/cjs/Formatter/Formatter.d.ts +44 -44
- package/lib/cjs/Formatter/Formatter.js +371 -371
- package/lib/cjs/Formatter/Formatter.js.map +1 -1
- package/lib/cjs/Formatter/FormatterSpec.d.ts +39 -39
- package/lib/cjs/Formatter/FormatterSpec.js +101 -101
- package/lib/cjs/Formatter/FormatterSpec.js.map +1 -1
- package/lib/cjs/Formatter/Interfaces.d.ts +62 -62
- package/lib/cjs/Formatter/Interfaces.js +17 -17
- package/lib/cjs/Formatter/Interfaces.js.map +1 -1
- package/lib/cjs/Interfaces.d.ts +86 -86
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js +9 -9
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Parser.d.ts +93 -93
- package/lib/cjs/Parser.d.ts.map +1 -1
- package/lib/cjs/Parser.js +592 -592
- package/lib/cjs/Parser.js.map +1 -1
- package/lib/cjs/ParserSpec.d.ts +34 -34
- package/lib/cjs/ParserSpec.js +47 -47
- package/lib/cjs/ParserSpec.js.map +1 -1
- package/lib/cjs/Quantity.d.ts +27 -27
- package/lib/cjs/Quantity.js +46 -46
- package/lib/cjs/Quantity.js.map +1 -1
- package/lib/cjs/Unit.d.ts +25 -25
- package/lib/cjs/Unit.js +44 -44
- package/lib/cjs/Unit.js.map +1 -1
- package/lib/cjs/core-quantity.d.ts +19 -19
- package/lib/cjs/core-quantity.js +39 -35
- package/lib/cjs/core-quantity.js.map +1 -1
- package/lib/esm/Constants.d.ts +27 -27
- package/lib/esm/Constants.js +49 -48
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/Exception.d.ts +26 -26
- package/lib/esm/Exception.js +34 -34
- package/lib/esm/Exception.js.map +1 -1
- package/lib/esm/Formatter/Format.d.ts +91 -91
- package/lib/esm/Formatter/Format.js +323 -323
- package/lib/esm/Formatter/Format.js.map +1 -1
- package/lib/esm/Formatter/FormatEnums.d.ts +133 -133
- package/lib/esm/Formatter/FormatEnums.js +302 -302
- package/lib/esm/Formatter/FormatEnums.js.map +1 -1
- package/lib/esm/Formatter/Formatter.d.ts +44 -44
- package/lib/esm/Formatter/Formatter.js +368 -367
- package/lib/esm/Formatter/Formatter.js.map +1 -1
- package/lib/esm/Formatter/FormatterSpec.d.ts +39 -39
- package/lib/esm/Formatter/FormatterSpec.js +97 -97
- package/lib/esm/Formatter/FormatterSpec.js.map +1 -1
- package/lib/esm/Formatter/Interfaces.d.ts +62 -62
- package/lib/esm/Formatter/Interfaces.js +13 -13
- package/lib/esm/Formatter/Interfaces.js.map +1 -1
- package/lib/esm/Interfaces.d.ts +86 -86
- package/lib/esm/Interfaces.d.ts.map +1 -1
- package/lib/esm/Interfaces.js +8 -8
- package/lib/esm/Interfaces.js.map +1 -1
- package/lib/esm/Parser.d.ts +93 -93
- package/lib/esm/Parser.d.ts.map +1 -1
- package/lib/esm/Parser.js +589 -588
- package/lib/esm/Parser.js.map +1 -1
- package/lib/esm/ParserSpec.d.ts +34 -34
- package/lib/esm/ParserSpec.js +43 -43
- package/lib/esm/ParserSpec.js.map +1 -1
- package/lib/esm/Quantity.d.ts +27 -27
- package/lib/esm/Quantity.js +42 -42
- package/lib/esm/Quantity.js.map +1 -1
- package/lib/esm/Unit.d.ts +25 -25
- package/lib/esm/Unit.js +39 -39
- package/lib/esm/Unit.js.map +1 -1
- package/lib/esm/core-quantity.d.ts +19 -19
- package/lib/esm/core-quantity.js +23 -23
- package/lib/esm/core-quantity.js.map +1 -1
- package/package.json +6 -6
package/lib/cjs/Unit.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Quantity
|
|
3
|
-
*/
|
|
4
|
-
import { UnitProps } from "./Interfaces";
|
|
5
|
-
/** This class provides basic implementation of UnitProps interface.
|
|
6
|
-
* @beta
|
|
7
|
-
*/
|
|
8
|
-
export declare class BasicUnit implements UnitProps {
|
|
9
|
-
name: string;
|
|
10
|
-
label: string;
|
|
11
|
-
phenomenon: string;
|
|
12
|
-
isValid: boolean;
|
|
13
|
-
system: string;
|
|
14
|
-
constructor(name: string, label: string, phenomenon: string, system?: string);
|
|
15
|
-
}
|
|
16
|
-
/** This class is a convenience class that can be returned when a valid Unit cannot be determined.
|
|
17
|
-
* @beta
|
|
18
|
-
*/
|
|
19
|
-
export declare class BadUnit implements UnitProps {
|
|
20
|
-
name: string;
|
|
21
|
-
label: string;
|
|
22
|
-
phenomenon: string;
|
|
23
|
-
isValid: boolean;
|
|
24
|
-
system: string;
|
|
25
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Quantity
|
|
3
|
+
*/
|
|
4
|
+
import { UnitProps } from "./Interfaces";
|
|
5
|
+
/** This class provides basic implementation of UnitProps interface.
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export declare class BasicUnit implements UnitProps {
|
|
9
|
+
name: string;
|
|
10
|
+
label: string;
|
|
11
|
+
phenomenon: string;
|
|
12
|
+
isValid: boolean;
|
|
13
|
+
system: string;
|
|
14
|
+
constructor(name: string, label: string, phenomenon: string, system?: string);
|
|
15
|
+
}
|
|
16
|
+
/** This class is a convenience class that can be returned when a valid Unit cannot be determined.
|
|
17
|
+
* @beta
|
|
18
|
+
*/
|
|
19
|
+
export declare class BadUnit implements UnitProps {
|
|
20
|
+
name: string;
|
|
21
|
+
label: string;
|
|
22
|
+
phenomenon: string;
|
|
23
|
+
isValid: boolean;
|
|
24
|
+
system: string;
|
|
25
|
+
}
|
|
26
26
|
//# sourceMappingURL=Unit.d.ts.map
|
package/lib/cjs/Unit.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
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 Quantity
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.BadUnit = exports.BasicUnit = void 0;
|
|
11
|
-
/** This class provides basic implementation of UnitProps interface.
|
|
12
|
-
* @beta
|
|
13
|
-
*/
|
|
14
|
-
class BasicUnit {
|
|
15
|
-
constructor(name, label, phenomenon, system) {
|
|
16
|
-
this.name = "";
|
|
17
|
-
this.label = "";
|
|
18
|
-
this.phenomenon = "";
|
|
19
|
-
this.isValid = false;
|
|
20
|
-
this.system = "unknown";
|
|
21
|
-
if (name && name.length > 0 && label && label.length > 0 && phenomenon && phenomenon.length > 0) {
|
|
22
|
-
this.name = name;
|
|
23
|
-
this.label = label;
|
|
24
|
-
this.phenomenon = phenomenon;
|
|
25
|
-
this.isValid = true;
|
|
26
|
-
if (system)
|
|
27
|
-
this.system = system;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.BasicUnit = BasicUnit;
|
|
32
|
-
/** This class is a convenience class that can be returned when a valid Unit cannot be determined.
|
|
33
|
-
* @beta
|
|
34
|
-
*/
|
|
35
|
-
class BadUnit {
|
|
36
|
-
constructor() {
|
|
37
|
-
this.name = "";
|
|
38
|
-
this.label = "";
|
|
39
|
-
this.phenomenon = "";
|
|
40
|
-
this.isValid = false;
|
|
41
|
-
this.system = "unknown";
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.BadUnit = BadUnit;
|
|
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 Quantity
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.BadUnit = exports.BasicUnit = void 0;
|
|
11
|
+
/** This class provides basic implementation of UnitProps interface.
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
class BasicUnit {
|
|
15
|
+
constructor(name, label, phenomenon, system) {
|
|
16
|
+
this.name = "";
|
|
17
|
+
this.label = "";
|
|
18
|
+
this.phenomenon = "";
|
|
19
|
+
this.isValid = false;
|
|
20
|
+
this.system = "unknown";
|
|
21
|
+
if (name && name.length > 0 && label && label.length > 0 && phenomenon && phenomenon.length > 0) {
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.label = label;
|
|
24
|
+
this.phenomenon = phenomenon;
|
|
25
|
+
this.isValid = true;
|
|
26
|
+
if (system)
|
|
27
|
+
this.system = system;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.BasicUnit = BasicUnit;
|
|
32
|
+
/** This class is a convenience class that can be returned when a valid Unit cannot be determined.
|
|
33
|
+
* @beta
|
|
34
|
+
*/
|
|
35
|
+
class BadUnit {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.name = "";
|
|
38
|
+
this.label = "";
|
|
39
|
+
this.phenomenon = "";
|
|
40
|
+
this.isValid = false;
|
|
41
|
+
this.system = "unknown";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.BadUnit = BadUnit;
|
|
45
45
|
//# sourceMappingURL=Unit.js.map
|
package/lib/cjs/Unit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Unit.js","sourceRoot":"","sources":["../../src/Unit.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;GAEG;AACH,MAAa,SAAS;IAOpB,YAAY,IAAY,EAAE,KAAa,EAAE,UAAkB,EAAE,MAAe;QANrE,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,eAAU,GAAG,EAAE,CAAC;QAChB,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAW,SAAS,CAAC;QAGhC,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,MAAM;gBACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACxB;IACH,CAAC;CACF;AAjBD,8BAiBC;AAED;;GAEG;AACH,MAAa,OAAO;IAApB;QACS,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,eAAU,GAAG,EAAE,CAAC;QAChB,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAG,SAAS,CAAC;IAC5B,CAAC;CAAA;AAND,0BAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Unit.js","sourceRoot":"","sources":["../../src/Unit.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;GAEG;AACH,MAAa,SAAS;IAOpB,YAAY,IAAY,EAAE,KAAa,EAAE,UAAkB,EAAE,MAAe;QANrE,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,eAAU,GAAG,EAAE,CAAC;QAChB,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAW,SAAS,CAAC;QAGhC,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/F,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,MAAM;gBACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACxB;IACH,CAAC;CACF;AAjBD,8BAiBC;AAED;;GAEG;AACH,MAAa,OAAO;IAApB;QACS,SAAI,GAAG,EAAE,CAAC;QACV,UAAK,GAAG,EAAE,CAAC;QACX,eAAU,GAAG,EAAE,CAAC;QAChB,YAAO,GAAG,KAAK,CAAC;QAChB,WAAM,GAAG,SAAS,CAAC;IAC5B,CAAC;CAAA;AAND,0BAMC","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 Quantity\n */\n\nimport { UnitProps } from \"./Interfaces\";\n\n/** This class provides basic implementation of UnitProps interface.\n * @beta\n */\nexport class BasicUnit implements UnitProps {\n public name = \"\";\n public label = \"\";\n public phenomenon = \"\";\n public isValid = false;\n public system: string = \"unknown\";\n\n constructor(name: string, label: string, phenomenon: string, system?: string) {\n if (name && name.length > 0 && label && label.length > 0 && phenomenon && phenomenon.length > 0) {\n this.name = name;\n this.label = label;\n this.phenomenon = phenomenon;\n this.isValid = true;\n if (system)\n this.system = system;\n }\n }\n}\n\n/** This class is a convenience class that can be returned when a valid Unit cannot be determined.\n * @beta\n */\nexport class BadUnit implements UnitProps {\n public name = \"\";\n public label = \"\";\n public phenomenon = \"\";\n public isValid = false;\n public system = \"unknown\";\n}\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from "./Constants";
|
|
2
|
-
export * from "./Exception";
|
|
3
|
-
export * from "./Interfaces";
|
|
4
|
-
export * from "./Parser";
|
|
5
|
-
export * from "./ParserSpec";
|
|
6
|
-
export * from "./Quantity";
|
|
7
|
-
export * from "./Unit";
|
|
8
|
-
export * from "./Formatter/Format";
|
|
9
|
-
export * from "./Formatter/FormatterSpec";
|
|
10
|
-
export * from "./Formatter/FormatEnums";
|
|
11
|
-
export * from "./Formatter/Formatter";
|
|
12
|
-
export * from "./Formatter/Interfaces";
|
|
13
|
-
/** @docs-package-description
|
|
14
|
-
* The core-quantity package always runs in a web browser. It contains classes, interfaces, and definitions for formatting and parsing quantity values.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* @docs-group-description Quantity
|
|
18
|
-
* Classes, Interfaces, and definitions used to format and parse quantity values.
|
|
19
|
-
*/
|
|
1
|
+
export * from "./Constants";
|
|
2
|
+
export * from "./Exception";
|
|
3
|
+
export * from "./Interfaces";
|
|
4
|
+
export * from "./Parser";
|
|
5
|
+
export * from "./ParserSpec";
|
|
6
|
+
export * from "./Quantity";
|
|
7
|
+
export * from "./Unit";
|
|
8
|
+
export * from "./Formatter/Format";
|
|
9
|
+
export * from "./Formatter/FormatterSpec";
|
|
10
|
+
export * from "./Formatter/FormatEnums";
|
|
11
|
+
export * from "./Formatter/Formatter";
|
|
12
|
+
export * from "./Formatter/Interfaces";
|
|
13
|
+
/** @docs-package-description
|
|
14
|
+
* The core-quantity package always runs in a web browser. It contains classes, interfaces, and definitions for formatting and parsing quantity values.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @docs-group-description Quantity
|
|
18
|
+
* Classes, Interfaces, and definitions used to format and parse quantity values.
|
|
19
|
+
*/
|
|
20
20
|
//# sourceMappingURL=core-quantity.d.ts.map
|
package/lib/cjs/core-quantity.js
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./
|
|
28
|
-
__exportStar(require("./Formatter/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
19
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
__exportStar(require("./Constants"), exports);
|
|
22
|
+
__exportStar(require("./Exception"), exports);
|
|
23
|
+
__exportStar(require("./Interfaces"), exports);
|
|
24
|
+
__exportStar(require("./Parser"), exports);
|
|
25
|
+
__exportStar(require("./ParserSpec"), exports);
|
|
26
|
+
__exportStar(require("./Quantity"), exports);
|
|
27
|
+
__exportStar(require("./Unit"), exports);
|
|
28
|
+
__exportStar(require("./Formatter/Format"), exports);
|
|
29
|
+
__exportStar(require("./Formatter/FormatterSpec"), exports);
|
|
30
|
+
__exportStar(require("./Formatter/FormatEnums"), exports);
|
|
31
|
+
__exportStar(require("./Formatter/Formatter"), exports);
|
|
32
|
+
__exportStar(require("./Formatter/Interfaces"), exports);
|
|
33
|
+
/** @docs-package-description
|
|
34
|
+
* The core-quantity package always runs in a web browser. It contains classes, interfaces, and definitions for formatting and parsing quantity values.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* @docs-group-description Quantity
|
|
38
|
+
* Classes, Interfaces, and definitions used to format and parse quantity values.
|
|
39
|
+
*/
|
|
36
40
|
//# sourceMappingURL=core-quantity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-quantity.js","sourceRoot":"","sources":["../../src/core-quantity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-quantity.js","sourceRoot":"","sources":["../../src/core-quantity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,yCAAuB;AAEvB,qDAAmC;AACnC,4DAA0C;AAC1C,0DAAwC;AACxC,wDAAsC;AACtC,yDAAuC;AAEvC;;GAEG;AAEH;;;GAGG","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*--------------------------------------------------------------------------------------------*/\nexport * from \"./Constants\";\nexport * from \"./Exception\";\nexport * from \"./Interfaces\";\nexport * from \"./Parser\";\nexport * from \"./ParserSpec\";\nexport * from \"./Quantity\";\nexport * from \"./Unit\";\n\nexport * from \"./Formatter/Format\";\nexport * from \"./Formatter/FormatterSpec\";\nexport * from \"./Formatter/FormatEnums\";\nexport * from \"./Formatter/Formatter\";\nexport * from \"./Formatter/Interfaces\";\n\n/** @docs-package-description\n * The core-quantity package always runs in a web browser. It contains classes, interfaces, and definitions for formatting and parsing quantity values.\n */\n\n/**\n * @docs-group-description Quantity\n * Classes, Interfaces, and definitions used to format and parse quantity values.\n */\n"]}
|
package/lib/esm/Constants.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/** Constants used internally for both formatting and parsing.
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export declare class QuantityConstants {
|
|
5
|
-
static readonly CHAR_COMMA = 44;
|
|
6
|
-
static readonly CHAR_SPACE = 32;
|
|
7
|
-
static readonly CHAR_NUMBER = 35;
|
|
8
|
-
static readonly CHAR_PLUS = 43;
|
|
9
|
-
static readonly CHAR_MINUS = 45;
|
|
10
|
-
static readonly CHAR_PERIOD = 46;
|
|
11
|
-
static readonly CHAR_SLASH = 47;
|
|
12
|
-
static readonly CHAR_DIVISION_SLASH = 8725;
|
|
13
|
-
static readonly CHAR_FRACTION_SLASH = 8260;
|
|
14
|
-
static readonly CHAR_ONE_QUARTER = 188;
|
|
15
|
-
static readonly CHAR_ONE_HALF = 189;
|
|
16
|
-
static readonly CHAR_THREE_QUARTER = 190;
|
|
17
|
-
static readonly CHAR_DIGIT_ZERO = 48;
|
|
18
|
-
static readonly CHAR_DIGIT_NINE = 57;
|
|
19
|
-
static readonly CHAR_UPPER_E = 69;
|
|
20
|
-
static readonly CHAR_LOWER_E = 101;
|
|
21
|
-
private static _LOCALE_DECIMAL_SEPARATOR;
|
|
22
|
-
private static _LOCALE_THOUSAND_SEPARATOR;
|
|
23
|
-
/** Return the decimal separator for the current locale. */
|
|
24
|
-
static get LocaleSpecificDecimalSeparator(): string;
|
|
25
|
-
/** Return the thousand separator for the current locale. */
|
|
26
|
-
static get LocaleSpecificThousandSeparator(): string;
|
|
27
|
-
}
|
|
1
|
+
/** Constants used internally for both formatting and parsing.
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare class QuantityConstants {
|
|
5
|
+
static readonly CHAR_COMMA = 44;
|
|
6
|
+
static readonly CHAR_SPACE = 32;
|
|
7
|
+
static readonly CHAR_NUMBER = 35;
|
|
8
|
+
static readonly CHAR_PLUS = 43;
|
|
9
|
+
static readonly CHAR_MINUS = 45;
|
|
10
|
+
static readonly CHAR_PERIOD = 46;
|
|
11
|
+
static readonly CHAR_SLASH = 47;
|
|
12
|
+
static readonly CHAR_DIVISION_SLASH = 8725;
|
|
13
|
+
static readonly CHAR_FRACTION_SLASH = 8260;
|
|
14
|
+
static readonly CHAR_ONE_QUARTER = 188;
|
|
15
|
+
static readonly CHAR_ONE_HALF = 189;
|
|
16
|
+
static readonly CHAR_THREE_QUARTER = 190;
|
|
17
|
+
static readonly CHAR_DIGIT_ZERO = 48;
|
|
18
|
+
static readonly CHAR_DIGIT_NINE = 57;
|
|
19
|
+
static readonly CHAR_UPPER_E = 69;
|
|
20
|
+
static readonly CHAR_LOWER_E = 101;
|
|
21
|
+
private static _LOCALE_DECIMAL_SEPARATOR;
|
|
22
|
+
private static _LOCALE_THOUSAND_SEPARATOR;
|
|
23
|
+
/** Return the decimal separator for the current locale. */
|
|
24
|
+
static get LocaleSpecificDecimalSeparator(): string;
|
|
25
|
+
/** Return the thousand separator for the current locale. */
|
|
26
|
+
static get LocaleSpecificThousandSeparator(): string;
|
|
27
|
+
}
|
|
28
28
|
//# sourceMappingURL=Constants.d.ts.map
|
package/lib/esm/Constants.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
6
|
-
/** Constants used internally for both formatting and parsing.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/** Return the decimal separator for the current locale. */
|
|
11
|
-
static get LocaleSpecificDecimalSeparator() {
|
|
12
|
-
if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)
|
|
13
|
-
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
14
|
-
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = ".";
|
|
15
|
-
const matches = (12345.6789).toLocaleString().match(/345(.*)67/);
|
|
16
|
-
if (matches && matches.length > 1)
|
|
17
|
-
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];
|
|
18
|
-
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
19
|
-
}
|
|
20
|
-
/** Return the thousand separator for the current locale. */
|
|
21
|
-
static get LocaleSpecificThousandSeparator() {
|
|
22
|
-
if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)
|
|
23
|
-
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
24
|
-
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = ",";
|
|
25
|
-
const matches = (12345.6789).toLocaleString().match(/12(.*)345/);
|
|
26
|
-
if (matches && matches.length > 0)
|
|
27
|
-
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];
|
|
28
|
-
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
QuantityConstants.CHAR_COMMA = 44;
|
|
32
|
-
QuantityConstants.CHAR_SPACE = 32;
|
|
33
|
-
QuantityConstants.CHAR_NUMBER = 35;
|
|
34
|
-
QuantityConstants.CHAR_PLUS = 43;
|
|
35
|
-
QuantityConstants.CHAR_MINUS = 45;
|
|
36
|
-
QuantityConstants.CHAR_PERIOD = 46;
|
|
37
|
-
QuantityConstants.CHAR_SLASH = 47;
|
|
38
|
-
QuantityConstants.CHAR_DIVISION_SLASH = 8725;
|
|
39
|
-
QuantityConstants.CHAR_FRACTION_SLASH = 8260;
|
|
40
|
-
QuantityConstants.CHAR_ONE_QUARTER = 188;
|
|
41
|
-
QuantityConstants.CHAR_ONE_HALF = 189;
|
|
42
|
-
QuantityConstants.CHAR_THREE_QUARTER = 190;
|
|
43
|
-
QuantityConstants.CHAR_DIGIT_ZERO = 48;
|
|
44
|
-
QuantityConstants.CHAR_DIGIT_NINE = 57;
|
|
45
|
-
QuantityConstants.CHAR_UPPER_E = 69;
|
|
46
|
-
QuantityConstants.CHAR_LOWER_E = 101;
|
|
47
|
-
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = "";
|
|
48
|
-
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = "";
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
6
|
+
/** Constants used internally for both formatting and parsing.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
class QuantityConstants {
|
|
10
|
+
/** Return the decimal separator for the current locale. */
|
|
11
|
+
static get LocaleSpecificDecimalSeparator() {
|
|
12
|
+
if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)
|
|
13
|
+
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
14
|
+
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = ".";
|
|
15
|
+
const matches = (12345.6789).toLocaleString().match(/345(.*)67/);
|
|
16
|
+
if (matches && matches.length > 1)
|
|
17
|
+
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];
|
|
18
|
+
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
19
|
+
}
|
|
20
|
+
/** Return the thousand separator for the current locale. */
|
|
21
|
+
static get LocaleSpecificThousandSeparator() {
|
|
22
|
+
if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)
|
|
23
|
+
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
24
|
+
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = ",";
|
|
25
|
+
const matches = (12345.6789).toLocaleString().match(/12(.*)345/);
|
|
26
|
+
if (matches && matches.length > 0)
|
|
27
|
+
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];
|
|
28
|
+
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
QuantityConstants.CHAR_COMMA = 44;
|
|
32
|
+
QuantityConstants.CHAR_SPACE = 32;
|
|
33
|
+
QuantityConstants.CHAR_NUMBER = 35;
|
|
34
|
+
QuantityConstants.CHAR_PLUS = 43;
|
|
35
|
+
QuantityConstants.CHAR_MINUS = 45;
|
|
36
|
+
QuantityConstants.CHAR_PERIOD = 46;
|
|
37
|
+
QuantityConstants.CHAR_SLASH = 47;
|
|
38
|
+
QuantityConstants.CHAR_DIVISION_SLASH = 8725;
|
|
39
|
+
QuantityConstants.CHAR_FRACTION_SLASH = 8260;
|
|
40
|
+
QuantityConstants.CHAR_ONE_QUARTER = 188;
|
|
41
|
+
QuantityConstants.CHAR_ONE_HALF = 189;
|
|
42
|
+
QuantityConstants.CHAR_THREE_QUARTER = 190;
|
|
43
|
+
QuantityConstants.CHAR_DIGIT_ZERO = 48;
|
|
44
|
+
QuantityConstants.CHAR_DIGIT_NINE = 57;
|
|
45
|
+
QuantityConstants.CHAR_UPPER_E = 69;
|
|
46
|
+
QuantityConstants.CHAR_LOWER_E = 101;
|
|
47
|
+
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = "";
|
|
48
|
+
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = "";
|
|
49
|
+
export { QuantityConstants };
|
|
49
50
|
//# sourceMappingURL=Constants.js.map
|
package/lib/esm/Constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,yDAAyD;AAEzD;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,yDAAyD;AAEzD;;GAEG;AACH,MAAa,iBAAiB;IAoB5B,2DAA2D;IACpD,MAAM,KAAK,8BAA8B;QAC9C,IAAI,iBAAiB,CAAC,yBAAyB,CAAC,MAAM,GAAG,CAAC;YACxD,OAAO,iBAAiB,CAAC,yBAAyB,CAAC;QAErD,iBAAiB,CAAC,yBAAyB,GAAG,GAAG,CAAC;QAClD,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,EAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClE,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAC/B,iBAAiB,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAE3D,OAAO,iBAAiB,CAAC,yBAAyB,CAAC;IACrD,CAAC;IAED,4DAA4D;IACrD,MAAM,KAAK,+BAA+B;QAC/C,IAAI,iBAAiB,CAAC,0BAA0B,CAAC,MAAM,GAAG,CAAC;YACzD,OAAO,iBAAiB,CAAC,0BAA0B,CAAC;QAEtD,iBAAiB,CAAC,0BAA0B,GAAG,GAAG,CAAC;QACnD,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,EAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClE,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAC/B,iBAAiB,CAAC,0BAA0B,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAE5D,OAAO,iBAAiB,CAAC,0BAA0B,CAAC;IACtD,CAAC;;AA3CsB,4BAAU,GAAG,EAAE,CAAC;AAChB,4BAAU,GAAG,EAAE,CAAC;AAChB,6BAAW,GAAG,EAAE,CAAC;AACjB,2BAAS,GAAG,EAAE,CAAC;AACf,4BAAU,GAAG,EAAE,CAAC;AAChB,6BAAW,GAAG,EAAE,CAAC;AACjB,4BAAU,GAAG,EAAE,CAAC;AAChB,qCAAmB,GAAG,IAAI,CAAC;AAC3B,qCAAmB,GAAG,IAAI,CAAC;AAC3B,kCAAgB,GAAG,GAAG,CAAC;AACvB,+BAAa,GAAG,GAAG,CAAC;AACpB,oCAAkB,GAAG,GAAG,CAAC;AACzB,iCAAe,GAAG,EAAE,CAAC;AACrB,iCAAe,GAAG,EAAE,CAAC;AACrB,8BAAY,GAAG,EAAE,CAAC;AAClB,8BAAY,GAAG,GAAG,CAAC;AAC3B,2CAAyB,GAAG,EAAE,CAAC;AAC/B,4CAA0B,GAAG,EAAE,CAAC;SAlBpC,iBAAiB","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/* eslint-disable @typescript-eslint/naming-convention */\n\n/** Constants used internally for both formatting and parsing.\n * @internal\n */\nexport class QuantityConstants {\n public static readonly CHAR_COMMA = 44;\n public static readonly CHAR_SPACE = 32;\n public static readonly CHAR_NUMBER = 35;\n public static readonly CHAR_PLUS = 43;\n public static readonly CHAR_MINUS = 45;\n public static readonly CHAR_PERIOD = 46;\n public static readonly CHAR_SLASH = 47;\n public static readonly CHAR_DIVISION_SLASH = 8725;\n public static readonly CHAR_FRACTION_SLASH = 8260;\n public static readonly CHAR_ONE_QUARTER = 188;\n public static readonly CHAR_ONE_HALF = 189;\n public static readonly CHAR_THREE_QUARTER = 190;\n public static readonly CHAR_DIGIT_ZERO = 48;\n public static readonly CHAR_DIGIT_NINE = 57;\n public static readonly CHAR_UPPER_E = 69;\n public static readonly CHAR_LOWER_E = 101;\n private static _LOCALE_DECIMAL_SEPARATOR = \"\";\n private static _LOCALE_THOUSAND_SEPARATOR = \"\";\n\n /** Return the decimal separator for the current locale. */\n public static get LocaleSpecificDecimalSeparator(): string {\n if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\n\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = \".\";\n const matches = (12345.6789).toLocaleString()!.match(/345(.*)67/);\n if (matches && matches.length > 1)\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];\n\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\n }\n\n /** Return the thousand separator for the current locale. */\n public static get LocaleSpecificThousandSeparator(): string {\n if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\n\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = \",\";\n const matches = (12345.6789).toLocaleString()!.match(/12(.*)345/);\n if (matches && matches.length > 0)\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];\n\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\n }\n}\n"]}
|
package/lib/esm/Exception.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Quantity
|
|
3
|
-
*/
|
|
4
|
-
import { BentleyError } from "@itwin/core-bentley";
|
|
5
|
-
/**
|
|
6
|
-
* Status codes used during Quantity parsing and formatting processing.
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
export declare enum QuantityStatus {
|
|
10
|
-
QUANTITY_ERROR_BASE = 35039,
|
|
11
|
-
Success = 0,
|
|
12
|
-
InvalidJson = 35040,
|
|
13
|
-
InvalidCompositeFormat = 35041,
|
|
14
|
-
UnableToGenerateParseTokens = 35042,
|
|
15
|
-
NoValueOrUnitFoundInString = 35043,
|
|
16
|
-
UnitLabelSuppliedButNotMatched = 35044,
|
|
17
|
-
UnknownUnit = 35045,
|
|
18
|
-
UnableToConvertParseTokensToQuantity = 35046
|
|
19
|
-
}
|
|
20
|
-
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
21
|
-
* @beta
|
|
22
|
-
*/
|
|
23
|
-
export declare class QuantityError extends BentleyError {
|
|
24
|
-
readonly errorNumber: number;
|
|
25
|
-
constructor(errorNumber: number, message?: string);
|
|
26
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Quantity
|
|
3
|
+
*/
|
|
4
|
+
import { BentleyError } from "@itwin/core-bentley";
|
|
5
|
+
/**
|
|
6
|
+
* Status codes used during Quantity parsing and formatting processing.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export declare enum QuantityStatus {
|
|
10
|
+
QUANTITY_ERROR_BASE = 35039,
|
|
11
|
+
Success = 0,
|
|
12
|
+
InvalidJson = 35040,
|
|
13
|
+
InvalidCompositeFormat = 35041,
|
|
14
|
+
UnableToGenerateParseTokens = 35042,
|
|
15
|
+
NoValueOrUnitFoundInString = 35043,
|
|
16
|
+
UnitLabelSuppliedButNotMatched = 35044,
|
|
17
|
+
UnknownUnit = 35045,
|
|
18
|
+
UnableToConvertParseTokensToQuantity = 35046
|
|
19
|
+
}
|
|
20
|
+
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
export declare class QuantityError extends BentleyError {
|
|
24
|
+
readonly errorNumber: number;
|
|
25
|
+
constructor(errorNumber: number, message?: string);
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=Exception.d.ts.map
|
package/lib/esm/Exception.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Quantity
|
|
7
|
-
*/
|
|
8
|
-
import { assert, BentleyError } from "@itwin/core-bentley";
|
|
9
|
-
/**
|
|
10
|
-
* Status codes used during Quantity parsing and formatting processing.
|
|
11
|
-
* @beta
|
|
12
|
-
*/
|
|
13
|
-
export var QuantityStatus;
|
|
14
|
-
(function (QuantityStatus) {
|
|
15
|
-
QuantityStatus[QuantityStatus["QUANTITY_ERROR_BASE"] = 35039] = "QUANTITY_ERROR_BASE";
|
|
16
|
-
QuantityStatus[QuantityStatus["Success"] = 0] = "Success";
|
|
17
|
-
QuantityStatus[QuantityStatus["InvalidJson"] = 35040] = "InvalidJson";
|
|
18
|
-
QuantityStatus[QuantityStatus["InvalidCompositeFormat"] = 35041] = "InvalidCompositeFormat";
|
|
19
|
-
QuantityStatus[QuantityStatus["UnableToGenerateParseTokens"] = 35042] = "UnableToGenerateParseTokens";
|
|
20
|
-
QuantityStatus[QuantityStatus["NoValueOrUnitFoundInString"] = 35043] = "NoValueOrUnitFoundInString";
|
|
21
|
-
QuantityStatus[QuantityStatus["UnitLabelSuppliedButNotMatched"] = 35044] = "UnitLabelSuppliedButNotMatched";
|
|
22
|
-
QuantityStatus[QuantityStatus["UnknownUnit"] = 35045] = "UnknownUnit";
|
|
23
|
-
QuantityStatus[QuantityStatus["UnableToConvertParseTokensToQuantity"] = 35046] = "UnableToConvertParseTokensToQuantity";
|
|
24
|
-
})(QuantityStatus || (QuantityStatus = {}));
|
|
25
|
-
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
26
|
-
* @beta
|
|
27
|
-
*/
|
|
28
|
-
export class QuantityError extends BentleyError {
|
|
29
|
-
constructor(errorNumber, message) {
|
|
30
|
-
super(errorNumber, message);
|
|
31
|
-
this.errorNumber = errorNumber;
|
|
32
|
-
assert(errorNumber !== QuantityStatus.Success, message);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Quantity
|
|
7
|
+
*/
|
|
8
|
+
import { assert, BentleyError } from "@itwin/core-bentley";
|
|
9
|
+
/**
|
|
10
|
+
* Status codes used during Quantity parsing and formatting processing.
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export var QuantityStatus;
|
|
14
|
+
(function (QuantityStatus) {
|
|
15
|
+
QuantityStatus[QuantityStatus["QUANTITY_ERROR_BASE"] = 35039] = "QUANTITY_ERROR_BASE";
|
|
16
|
+
QuantityStatus[QuantityStatus["Success"] = 0] = "Success";
|
|
17
|
+
QuantityStatus[QuantityStatus["InvalidJson"] = 35040] = "InvalidJson";
|
|
18
|
+
QuantityStatus[QuantityStatus["InvalidCompositeFormat"] = 35041] = "InvalidCompositeFormat";
|
|
19
|
+
QuantityStatus[QuantityStatus["UnableToGenerateParseTokens"] = 35042] = "UnableToGenerateParseTokens";
|
|
20
|
+
QuantityStatus[QuantityStatus["NoValueOrUnitFoundInString"] = 35043] = "NoValueOrUnitFoundInString";
|
|
21
|
+
QuantityStatus[QuantityStatus["UnitLabelSuppliedButNotMatched"] = 35044] = "UnitLabelSuppliedButNotMatched";
|
|
22
|
+
QuantityStatus[QuantityStatus["UnknownUnit"] = 35045] = "UnknownUnit";
|
|
23
|
+
QuantityStatus[QuantityStatus["UnableToConvertParseTokensToQuantity"] = 35046] = "UnableToConvertParseTokensToQuantity";
|
|
24
|
+
})(QuantityStatus || (QuantityStatus = {}));
|
|
25
|
+
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
26
|
+
* @beta
|
|
27
|
+
*/
|
|
28
|
+
export class QuantityError extends BentleyError {
|
|
29
|
+
constructor(errorNumber, message) {
|
|
30
|
+
super(errorNumber, message);
|
|
31
|
+
this.errorNumber = errorNumber;
|
|
32
|
+
assert(errorNumber !== QuantityStatus.Success, message);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=Exception.js.map
|
package/lib/esm/Exception.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../src/Exception.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAN,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB,qFAA4B,CAAA;IAC5B,yDAAW,CAAA;IACX,qEAAqC,CAAA;IACrC,2FAAgD,CAAA;IAChD,qGAAqD,CAAA;IACrD,mGAAoD,CAAA;IACpD,2GAAwD,CAAA;IACxD,qEAAqC,CAAA;IACrC,uHAA8D,CAAA;AAChE,CAAC,EAVW,cAAc,KAAd,cAAc,QAUzB;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C,YAA4C,WAAmB,EAAE,OAAgB;QAC/E,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QADc,gBAAW,GAAX,WAAW,CAAQ;QAE7D,MAAM,CAAC,WAAW,KAAK,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../src/Exception.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAN,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB,qFAA4B,CAAA;IAC5B,yDAAW,CAAA;IACX,qEAAqC,CAAA;IACrC,2FAAgD,CAAA;IAChD,qGAAqD,CAAA;IACrD,mGAAoD,CAAA;IACpD,2GAAwD,CAAA;IACxD,qEAAqC,CAAA;IACrC,uHAA8D,CAAA;AAChE,CAAC,EAVW,cAAc,KAAd,cAAc,QAUzB;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C,YAA4C,WAAmB,EAAE,OAAgB;QAC/E,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QADc,gBAAW,GAAX,WAAW,CAAQ;QAE7D,MAAM,CAAC,WAAW,KAAK,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF","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 Quantity\n */\n\nimport { assert, BentleyError } from \"@itwin/core-bentley\";\n\n/**\n * Status codes used during Quantity parsing and formatting processing.\n * @beta\n */\nexport enum QuantityStatus {\n QUANTITY_ERROR_BASE = 0x88DF,\n Success = 0,\n InvalidJson = QUANTITY_ERROR_BASE + 1,\n InvalidCompositeFormat = QUANTITY_ERROR_BASE + 2,\n UnableToGenerateParseTokens = QUANTITY_ERROR_BASE + 3,\n NoValueOrUnitFoundInString = QUANTITY_ERROR_BASE + 4,\n UnitLabelSuppliedButNotMatched = QUANTITY_ERROR_BASE + 5,\n UnknownUnit = QUANTITY_ERROR_BASE + 6,\n UnableToConvertParseTokensToQuantity = QUANTITY_ERROR_BASE + 7,\n}\n\n/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.\n * @beta\n */\nexport class QuantityError extends BentleyError {\n public constructor(public override readonly errorNumber: number, message?: string) {\n super(errorNumber, message);\n assert(errorNumber !== QuantityStatus.Success, message);\n }\n}\n"]}
|