@itwin/core-quantity 5.2.0-dev.29 → 5.2.0-dev.30
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.js.map +1 -1
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Formatter/Format.js.map +1 -1
- package/lib/cjs/Formatter/FormatEnums.js.map +1 -1
- package/lib/cjs/Formatter/Formatter.js.map +1 -1
- package/lib/cjs/Formatter/FormatterSpec.js.map +1 -1
- package/lib/cjs/Formatter/Interfaces.js.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Parser.js.map +1 -1
- package/lib/cjs/ParserSpec.js.map +1 -1
- package/lib/cjs/Quantity.js.map +1 -1
- package/lib/cjs/Unit.js.map +1 -1
- package/lib/cjs/core-quantity.js.map +1 -1
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/Exception.js.map +1 -1
- package/lib/esm/Formatter/Format.js.map +1 -1
- package/lib/esm/Formatter/FormatEnums.js.map +1 -1
- package/lib/esm/Formatter/Formatter.js.map +1 -1
- package/lib/esm/Formatter/FormatterSpec.js.map +1 -1
- package/lib/esm/Formatter/Interfaces.js.map +1 -1
- package/lib/esm/Interfaces.js.map +1 -1
- package/lib/esm/Parser.js.map +1 -1
- package/lib/esm/ParserSpec.js.map +1 -1
- package/lib/esm/Quantity.js.map +1 -1
- package/lib/esm/Unit.js.map +1 -1
- package/lib/esm/core-quantity.js.map +1 -1
- package/package.json +4 -4
package/lib/esm/Quantity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Quantity.js","sourceRoot":"","sources":["../../src/Quantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAiB,oBAAoB,EAAkC,MAAM,cAAc,CAAC;AAEnG;;;;;;;GAO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CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACjE,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC5C,CAAC;CACF;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,qFAAqF;QAC1G,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,KAAK,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,KAA0B;IACvE,IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,8CAA8C;IAC9C,IAAI,KAAK,CAAC,SAAS,KAAK,oBAAoB,CAAC,mBAAmB,EAAE,CAAC;QACjE,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC;IAED,yCAAyC;IACzC,cAAc,GAAG,CAAC,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IAEhE,+CAA+C;IAC/C,IAAI,KAAK,CAAC,SAAS,KAAK,oBAAoB,CAAC,oBAAoB,EAAE,CAAC;QAClE,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","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 { QuantityError, QuantityStatus } from \"./Exception\";\nimport { QuantityProps, UnitConversionInvert, UnitConversionProps, UnitProps } from \"./Interfaces\";\n\n/**\n * Checks if two numbers are approximately equal within given relative tolerance.\n * @param a - The first number to compare.\n * @param b - The second number to compare.\n * @param tolerance - Tolerance, scales based on the input number values (multiplied by 1, abs(a) or abs(b), whichever is biggest).\n * @returns True if the numbers are approximately equal, false otherwise.\n * @internal\n */\nexport function almostEqual(a: number, b: number, tolerance: number = 2.2204460492503131e-16): boolean {\n const absDiff = Math.abs(a - b);\n const scaledTolerance = Math.max(1, Math.abs(a), Math.abs(b)) * tolerance;\n return absDiff <= scaledTolerance;\n}\n\n/** The Quantity class is convenient container to specify both the magnitude and unit of a quantity. This class is commonly\n * returned as the result of parsing a string that represents a quantity.\n * @beta\n */\nexport class Quantity implements QuantityProps {\n protected _magnitude: number = 0.0;\n protected _unit: UnitProps;\n protected _isValid: boolean = false;\n\n public get unit(): UnitProps { return this._unit; }\n public get magnitude(): number { return this._magnitude; }\n public get isValid(): boolean { return this._isValid; }\n\n /** Constructor. The Quantity will only be set as valid if a unit is specified.\n * @param unit Defines the quantity's unit.\n * @param magnitude Defines the magnitude of the quantity.\n */\n public constructor(unit?: UnitProps, magnitude?: number) {\n if (undefined !== unit) {\n this._unit = unit;\n this._isValid = true;\n } else {\n this._unit = { name: \"unknown\", label: \"unknown\", phenomenon: \"unknown\", isValid: false, system: \"unknown\" };\n }\n\n if (undefined !== magnitude)\n this._magnitude = magnitude;\n }\n\n /** Convert a Quantity to the specified unit given the UnitConversion.\n * @param toUnit The new unit for the quantity.\n * @param conversion Defines the information needed to convert the Quantity's magnitude from the current unit to another unit. This conversion info is usually\n * returned from the UnitsProvider.\n */\n public convertTo(toUnit: UnitProps, conversion: UnitConversionProps): Quantity | undefined {\n const newMagnitude = applyConversion(this.magnitude, conversion);\n return new Quantity(toUnit, newMagnitude);\n }\n}\n\nfunction invert(input: number): number {\n if (almostZero(input)) // mimic the behavior of native here. We don't want to invert those very small values\n throw new QuantityError(QuantityStatus.InvertingZero, \"Cannot invert zero value\");\n return 1 / input;\n}\n\n/** Determines if a value is almost zero. (less than 1e-16)\n * @param value - The value to be checked.\n * @returns `true` if the value is almost zero, `false` otherwise.\n * @internal\n */\nexport function almostZero(value: number): boolean {\n return almostEqual(value, 0.0);\n}\n\n/**\n * Applies a unit conversion to a given value.\n * @param value - The value to be converted.\n * @param props - The unit conversion properties.\n * @returns The converted value.\n * @internal\n */\nexport function applyConversion(value: number, props: UnitConversionProps): number {\n let convertedValue = value;\n\n // Apply pre-conversion inversion if specified\n if (props.inversion === UnitConversionInvert.InvertPreConversion) {\n convertedValue = invert(convertedValue);\n }\n\n // Apply the conversion factor and offset\n convertedValue = (convertedValue * props.factor) + props.offset;\n\n // Apply post-conversion inversion if specified\n if (props.inversion === UnitConversionInvert.InvertPostConversion) {\n convertedValue = invert(convertedValue);\n }\n\n return convertedValue;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Quantity.js","sourceRoot":"","sources":["../../src/Quantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAiB,oBAAoB,EAAkC,MAAM,cAAc,CAAC;AAEnG;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,CAAS,EAAE,CAAS,EAAE,YAAoB,sBAAsB;IAC1F,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAC1E,OAAO,OAAO,IAAI,eAAe,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACT,UAAU,GAAW,GAAG,CAAC;IACzB,KAAK,CAAY;IACjB,QAAQ,GAAY,KAAK,CAAC;IAEpC,IAAW,IAAI,KAAgB,OA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IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,8CAA8C;IAC9C,IAAI,KAAK,CAAC,SAAS,KAAK,oBAAoB,CAAC,mBAAmB,EAAE,CAAC;QACjE,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC;IAED,yCAAyC;IACzC,cAAc,GAAG,CAAC,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IAEhE,+CAA+C;IAC/C,IAAI,KAAK,CAAC,SAAS,KAAK,oBAAoB,CAAC,oBAAoB,EAAE,CAAC;QAClE,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Quantity\r\n */\r\n\r\nimport { QuantityError, QuantityStatus } from \"./Exception\";\r\nimport { QuantityProps, UnitConversionInvert, UnitConversionProps, UnitProps } from \"./Interfaces\";\r\n\r\n/**\r\n * Checks if two numbers are approximately equal within given relative tolerance.\r\n * @param a - The first number to compare.\r\n * @param b - The second number to compare.\r\n * @param tolerance - Tolerance, scales based on the input number values (multiplied by 1, abs(a) or abs(b), whichever is biggest).\r\n * @returns True if the numbers are approximately equal, false otherwise.\r\n * @internal\r\n */\r\nexport function almostEqual(a: number, b: number, tolerance: number = 2.2204460492503131e-16): boolean {\r\n const absDiff = Math.abs(a - b);\r\n const scaledTolerance = Math.max(1, Math.abs(a), Math.abs(b)) * tolerance;\r\n return absDiff <= scaledTolerance;\r\n}\r\n\r\n/** The Quantity class is convenient container to specify both the magnitude and unit of a quantity. This class is commonly\r\n * returned as the result of parsing a string that represents a quantity.\r\n * @beta\r\n */\r\nexport class Quantity implements QuantityProps {\r\n protected _magnitude: number = 0.0;\r\n protected _unit: UnitProps;\r\n protected _isValid: boolean = false;\r\n\r\n public get unit(): UnitProps { return this._unit; }\r\n public get magnitude(): number { return this._magnitude; }\r\n public get isValid(): boolean { return this._isValid; }\r\n\r\n /** Constructor. The Quantity will only be set as valid if a unit is specified.\r\n * @param unit Defines the quantity's unit.\r\n * @param magnitude Defines the magnitude of the quantity.\r\n */\r\n public constructor(unit?: UnitProps, magnitude?: number) {\r\n if (undefined !== unit) {\r\n this._unit = unit;\r\n this._isValid = true;\r\n } else {\r\n this._unit = { name: \"unknown\", label: \"unknown\", phenomenon: \"unknown\", isValid: false, system: \"unknown\" };\r\n }\r\n\r\n if (undefined !== magnitude)\r\n this._magnitude = magnitude;\r\n }\r\n\r\n /** Convert a Quantity to the specified unit given the UnitConversion.\r\n * @param toUnit The new unit for the quantity.\r\n * @param conversion Defines the information needed to convert the Quantity's magnitude from the current unit to another unit. This conversion info is usually\r\n * returned from the UnitsProvider.\r\n */\r\n public convertTo(toUnit: UnitProps, conversion: UnitConversionProps): Quantity | undefined {\r\n const newMagnitude = applyConversion(this.magnitude, conversion);\r\n return new Quantity(toUnit, newMagnitude);\r\n }\r\n}\r\n\r\nfunction invert(input: number): number {\r\n if (almostZero(input)) // mimic the behavior of native here. We don't want to invert those very small values\r\n throw new QuantityError(QuantityStatus.InvertingZero, \"Cannot invert zero value\");\r\n return 1 / input;\r\n}\r\n\r\n/** Determines if a value is almost zero. (less than 1e-16)\r\n * @param value - The value to be checked.\r\n * @returns `true` if the value is almost zero, `false` otherwise.\r\n * @internal\r\n */\r\nexport function almostZero(value: number): boolean {\r\n return almostEqual(value, 0.0);\r\n}\r\n\r\n/**\r\n * Applies a unit conversion to a given value.\r\n * @param value - The value to be converted.\r\n * @param props - The unit conversion properties.\r\n * @returns The converted value.\r\n * @internal\r\n */\r\nexport function applyConversion(value: number, props: UnitConversionProps): number {\r\n let convertedValue = value;\r\n\r\n // Apply pre-conversion inversion if specified\r\n if (props.inversion === UnitConversionInvert.InvertPreConversion) {\r\n convertedValue = invert(convertedValue);\r\n }\r\n\r\n // Apply the conversion factor and offset\r\n convertedValue = (convertedValue * props.factor) + props.offset;\r\n\r\n // Apply post-conversion inversion if specified\r\n if (props.inversion === UnitConversionInvert.InvertPostConversion) {\r\n convertedValue = invert(convertedValue);\r\n }\r\n\r\n return convertedValue;\r\n}\r\n"]}
|
package/lib/esm/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,MAAM,OAAO,SAAS;IACb,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,GAAG,EAAE,CAAC;IACX,UAAU,GAAG,EAAE,CAAC;IAChB,OAAO,GAAG,KAAK,CAAC;IAChB,MAAM,GAAW,SAAS,CAAC;IAElC,YAAY,IAAY,EAAE,KAAa,EAAE,UAAkB,EAAE,MAAe;QAC1E,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,CAAC;YAChG,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;QACzB,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,OAAO;IACX,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,GAAG,EAAE,CAAC;IACX,UAAU,GAAG,EAAE,CAAC;IAChB,OAAO,GAAG,KAAK,CAAC;IAChB,MAAM,GAAG,SAAS,CAAC;CAC3B","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
|
+
{"version":3,"file":"Unit.js","sourceRoot":"","sources":["../../src/Unit.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH;;GAEG;AACH,MAAM,OAAO,SAAS;IACb,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,GAAG,EAAE,CAAC;IACX,UAAU,GAAG,EAAE,CAAC;IAChB,OAAO,GAAG,KAAK,CAAC;IAChB,MAAM,GAAW,SAAS,CAAC;IAElC,YAAY,IAAY,EAAE,KAAa,EAAE,UAAkB,EAAE,MAAe;QAC1E,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,CAAC;YAChG,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;QACzB,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,OAAO;IACX,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,GAAG,EAAE,CAAC;IACX,UAAU,GAAG,EAAE,CAAC;IAChB,OAAO,GAAG,KAAK,CAAC;IAChB,MAAM,GAAG,SAAS,CAAC;CAC3B","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 Quantity\r\n */\r\n\r\nimport { UnitProps } from \"./Interfaces\";\r\n\r\n/** This class provides basic implementation of UnitProps interface.\r\n * @beta\r\n */\r\nexport class BasicUnit implements UnitProps {\r\n public name = \"\";\r\n public label = \"\";\r\n public phenomenon = \"\";\r\n public isValid = false;\r\n public system: string = \"unknown\";\r\n\r\n constructor(name: string, label: string, phenomenon: string, system?: string) {\r\n if (name && name.length > 0 && label && label.length > 0 && phenomenon && phenomenon.length > 0) {\r\n this.name = name;\r\n this.label = label;\r\n this.phenomenon = phenomenon;\r\n this.isValid = true;\r\n if (system)\r\n this.system = system;\r\n }\r\n }\r\n}\r\n\r\n/** This class is a convenience class that can be returned when a valid Unit cannot be determined.\r\n * @beta\r\n */\r\nexport class BadUnit implements UnitProps {\r\n public name = \"\";\r\n public label = \"\";\r\n public phenomenon = \"\";\r\n public isValid = false;\r\n public system = \"unknown\";\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-quantity.js","sourceRoot":"","sources":["../../src/core-quantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AAEvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;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"]}
|
|
1
|
+
{"version":3,"file":"core-quantity.js","sourceRoot":"","sources":["../../src/core-quantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AAEvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AAEvC;;GAEG;AAEH;;;GAGG","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\nexport * from \"./Constants\";\r\nexport * from \"./Exception\";\r\nexport * from \"./Interfaces\";\r\nexport * from \"./Parser\";\r\nexport * from \"./ParserSpec\";\r\nexport * from \"./Quantity\";\r\nexport * from \"./Unit\";\r\n\r\nexport * from \"./Formatter/Format\";\r\nexport * from \"./Formatter/FormatterSpec\";\r\nexport * from \"./Formatter/FormatEnums\";\r\nexport * from \"./Formatter/Formatter\";\r\nexport * from \"./Formatter/Interfaces\";\r\n\r\n/** @docs-package-description\r\n * The core-quantity package always runs in a web browser. It contains classes, interfaces, and definitions for formatting and parsing quantity values.\r\n */\r\n\r\n/**\r\n * @docs-group-description Quantity\r\n * Classes, Interfaces, and definitions used to format and parse quantity values.\r\n */\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-quantity",
|
|
3
|
-
"version": "5.2.0-dev.
|
|
3
|
+
"version": "5.2.0-dev.30",
|
|
4
4
|
"description": "Quantity parsing, formatting and conversions for iModel.js",
|
|
5
5
|
"main": "lib/cjs/core-quantity.js",
|
|
6
6
|
"module": "lib/esm/core-quantity.js",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"rimraf": "^6.0.1",
|
|
29
29
|
"typescript": "~5.6.2",
|
|
30
30
|
"vitest": "^3.0.6",
|
|
31
|
-
"@itwin/build-tools": "5.2.0-dev.
|
|
32
|
-
"@itwin/core-bentley": "5.2.0-dev.
|
|
31
|
+
"@itwin/build-tools": "5.2.0-dev.30",
|
|
32
|
+
"@itwin/core-bentley": "5.2.0-dev.30"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@itwin/core-bentley": "5.2.0-dev.
|
|
35
|
+
"@itwin/core-bentley": "5.2.0-dev.30"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "npm run -s build:cjs && npm run -s build:esm",
|