@oliasoft-open-source/units 4.7.0 → 5.0.0-beta-1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sources":["../src/constants.ts","../src/utils.ts","../src/numbers/display-number.ts","../src/rounding/rounding.ts","../src/comparison/comparison.ts"],"mappings":";;;;AAQA,cAAa,MAAM,EAAE,MAAM;AAgO3B,cAAa,SAAS,EAAE,MAAM;AAiM9B,cAAa,aAAa,EAAE,MAAM;AA8GlC,cAAa,iBAAiB,EAAE,MAAM;AA4gBtC,cAAa,gBAAgB,EAAE,MAAM;AAcrC,cAAa,YAAY,EAAE,MAAM;AAYjC,cAAa,wBAAwB,EAAE,MAAM;AA0K7C,cAAa,WAAW;AAaxB,cAAa,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FnC,cAAa,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtzC9B,iBAAgB,oBAAoB;AAkBpC,cAAa,UAAU;AAevB,iBAAgB,SAAS;AA6BzB,iBAAgB,UAAU;AAW1B,cAAa,YAAY;AAWzB,iBAAgB,SAAS;AAyBzB,iBAAgB,uBAAuB;AAwCvC,iBAAgB,QAAQ,4BAA4B,QAAQ,UAAU,GAAG;AA8BzE,iBAAgB,UAAU;AAsB1B,iBAAgB,WAAW;AAgD3B,iBAAgB,WAAW;AAwC3B,cAAa,iBAAiB;AAgB9B,iBAAgB,QAAQ;AAaxB,cAAa,cAAc;;ACjU3B,KAAK,oBAAoB;;;;;;;;;;AA6HzB,cAAa,aAAa,6EAEd,oBAAoB;AA0ChC,cAAa,oBAAoB,oEAErB,oBAAoB;;AC/JhC,cAAa,KAAK;AA4GlB,cAAa,gBAAgB;AA8C7B,cAAa,uBAAuB;AA0EpC,cAAa,gBAAgB;AA8C7B,cAAa,uBAAuB;AAuEpC,cAAa,YAAY;AA2CzB,cAAa,YAAY;;AClazB,KAAK,OAAO;UAAiB,OAAO;;AACpC,KAAK,GAAG,uBACQ,MAAM,qBACf,OAAO,eAAe,OAAO;AAGpC,KAAK,aAAa,GAAG,GAAG;;;;;AAyCxB,cAAa,SAAS,sFAGX,aAA2D;AAuEtE,cAAa,sBAAsB,sFAGxB,aAA2D;AAoBtE,cAAa,mBAAmB,sFAGrB,aAA2D;AAmBtE,cAAa,aAAa,6BAGf,aAA2D","names":[]}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/constants.ts","../src/utils.ts","../src/numbers/display-number.ts","../src/rounding/rounding.ts","../src/comparison/comparison.ts"],"mappings":";;;;cAQa,MAAA,EAAQ,MAAA;AAAA,cAgOR,SAAA,EAAW,MAAA;AAAA,cAiMX,aAAA,EAAe,MAAA;AAAA,cA8Gf,iBAAA,EAAmB,MAAA,UAAgB,GAAA;AAAA,cA4gBnC,gBAAA,EAAkB,MAAA;AAAA,cAclB,YAAA,EAAc,MAAA;AAAA,cAYd,wBAAA,EAA0B,MAAA;AAAA,cA0K1B,WAAA;AAAA,cAaA,sBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8FA,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAO,KAAA,EACP,GAAA,UACA,GAAA,UACA,CAAA,cACC,KAAA;AAAA,cAsCU,YAAA,qDACX,KAAA,EAAO,KAAA,EACP,CAAA,cACC,KAAA;;;KCraE,OAAA,iBAAwB,OAAA,OAAc,CAAA,QAAS,CAAA;AAAA,KAC/C,GAAA,SACH,CAAA,GAAI,CAAA,SAAU,MAAA,qBACT,OAAA,CAAQ,CAAA,EAAG,CAAA,IAAK,CAAA,KAAM,OAAA,CAAQ,CAAA,EAAG,CAAA,IAAK,CAAA,IACvC,CAAA,GAAI,CAAA;AAAA,KAEL,aAAA,GAAgB,GAAA;EACjB,YAAA;AAAA;EACA,YAAA;AAAA;AAAA,cAuCS,SAAA,GACX,UAAA,0BACA,WAAA,0BACA,OAAA,GAAS,aAAA;AAAA,cAuEE,sBAAA,GACX,UAAA,0BACA,WAAA,0BACA,OAAA,GAAS,aAAA;AAAA,cAoBE,mBAAA,GACX,UAAA,0BACA,WAAA,0BACA,OAAA,GAAS,aAAA;AAAA,cAmBE,aAAA,GACX,CAAA,OACA,CAAA,OACA,OAAA,GAAS,aAAA"}
package/dist/index.js CHANGED
@@ -1,2 +1,7 @@
1
- export { A as ALT_UNITS, D as DEPRECATED_UNITS, I as INTERMEDIATE_CONVERSIONS, K as KNOWN_CONVERSIONS, a as KNOWN_UNITS, L as LABELS, Q as QUANTITIES_DESCRIPTION, U as UNITS_DESCRIPTION, b as UNIT_ALIASES, c as UNIT_FROM_KEY, d as allNumbers, e as altUnitsList, f as asFraction, g as charCount, h as checkAndCleanDecimalComma, i as cleanNum, j as cleanNumStr, k as convertAndGetValue, l as convertAndGetValueStrict, m as convertSamePrecision, n as convertTable, o as displayNumber, p as displayNumberToFixed, q as formatNumber, r as fraction, s as getAltUnitsListByQuantity, t as getNumberOfDigitsToShow, u as getQuantities, v as getUnit, w as getUnitsForQuantity, x as getValue, y as isCloseTo, z as isCloseToOrGreaterThan, B as isCloseToOrLessThan, C as isDeepCloseTo, E as isEmptyValueWithUnit, F as isFraction, G as isNonNumerical, H as isNumeric, J as isScientificStringNum, M as isValidNum, N as isValueWithUnit, O as label, P as numFraction, R as round, S as roundByMagnitude, T as roundByMagnitudeToFixed, V as roundByRange, W as roundNumberWithLabel, X as roundToDecimalPrecision, Y as roundToFixed, Z as roundToPrecision, _ as showAltUnitsList, $ as split, a0 as stripLeadingZeros, a1 as to, a2 as toBase, a3 as toNum, a4 as toString, a5 as unitFromKey, a6 as unitFromQuantity, a7 as unum, a8 as unumWithUnit, a9 as validateAndClean, aa as validateNumber, ab as withPrettyUnitLabel, ac as withUnit } from './units-DNoJOeDf.js';
2
- import 'fraction.js';
1
+ import { $ as displayNumber, A as DEPRECATED_UNITS, B as asFraction, C as unum, D as withPrettyUnitLabel, E as validateNumber, F as QUANTITIES_DESCRIPTION, G as fraction, H as cleanNum, I as UNITS_DESCRIPTION, J as isFraction, K as getNumberOfDigitsToShow, L as UNIT_ALIASES, M as KNOWN_CONVERSIONS, N as KNOWN_UNITS, O as withUnit, P as LABELS, Q as stripLeadingZeros, R as UNIT_FROM_KEY, S as unitFromQuantity, T as validateAndClean, U as cleanNumStr, V as charCount, W as formatNumber, X as isNumeric, Y as isNonNumerical, Z as numFraction, _ as showAltUnitsList, a as convertAndGetValue, at as roundToDecimalPrecision, b as toBase, c as convertTable, ct as isCloseTo, d as getUnit, dt as isDeepCloseTo, et as displayNumberToFixed, f as getUnitsForQuantity, ft as isScientificStringNum, g as roundNumberWithLabel, h as label, ht as toString, i as checkAndCleanDecimalComma, it as roundByRange, j as INTERMEDIATE_CONVERSIONS, k as ALT_UNITS, l as getAltUnitsListByQuantity, lt as isCloseToOrGreaterThan, m as isValueWithUnit, mt as toNum, nt as roundByMagnitude, o as convertAndGetValueStrict, ot as roundToFixed, p as getValue, pt as isValidNum, q as isEmptyValueWithUnit, r as altUnitsList, rt as roundByMagnitudeToFixed, s as convertSamePrecision, st as roundToPrecision, tt as round, u as getQuantities, ut as isCloseToOrLessThan, v as split, w as unumWithUnit, x as unitFromKey, y as to, z as allNumbers } from "./units2.js";
2
+ //#region src/index.ts
3
+ /* istanbul ignore file */
4
+ //#endregion
5
+ export { ALT_UNITS, DEPRECATED_UNITS, INTERMEDIATE_CONVERSIONS, KNOWN_CONVERSIONS, KNOWN_UNITS, LABELS, QUANTITIES_DESCRIPTION, UNITS_DESCRIPTION, UNIT_ALIASES, UNIT_FROM_KEY, allNumbers, altUnitsList, asFraction, charCount, checkAndCleanDecimalComma, cleanNum, cleanNumStr, convertAndGetValue, convertAndGetValueStrict, convertSamePrecision, convertTable, displayNumber, displayNumberToFixed, formatNumber, fraction, getAltUnitsListByQuantity, getNumberOfDigitsToShow, getQuantities, getUnit, getUnitsForQuantity, getValue, isCloseTo, isCloseToOrGreaterThan, isCloseToOrLessThan, isDeepCloseTo, isEmptyValueWithUnit, isFraction, isNonNumerical, isNumeric, isScientificStringNum, isValidNum, isValueWithUnit, label, numFraction, round, roundByMagnitude, roundByMagnitudeToFixed, roundByRange, roundNumberWithLabel, roundToDecimalPrecision, roundToFixed, roundToPrecision, showAltUnitsList, split, stripLeadingZeros, to, toBase, toNum, toString, unitFromKey, unitFromQuantity, unum, unumWithUnit, validateAndClean, validateNumber, withPrettyUnitLabel, withUnit };
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\nimport {\n label,\n showAltUnitsList,\n getAltUnitsListByQuantity,\n checkAndCleanDecimalComma,\n unitFromKey,\n to,\n split,\n unum,\n toBase,\n altUnitsList,\n convertTable,\n roundNumberWithLabel,\n withUnit,\n unumWithUnit,\n validateAndClean,\n isValueWithUnit,\n getValue,\n getUnit,\n convertSamePrecision,\n convertAndGetValue,\n convertAndGetValueStrict,\n getUnitsForQuantity,\n getQuantities,\n unitFromQuantity,\n withPrettyUnitLabel,\n validateNumber,\n} from './units.ts';\n\nimport {\n ALT_UNITS,\n LABELS,\n UNIT_FROM_KEY,\n KNOWN_CONVERSIONS,\n DEPRECATED_UNITS,\n UNIT_ALIASES,\n INTERMEDIATE_CONVERSIONS,\n KNOWN_UNITS,\n QUANTITIES_DESCRIPTION,\n UNITS_DESCRIPTION,\n} from './constants.ts';\n\nimport {\n isNumeric,\n isNonNumerical,\n isEmptyValueWithUnit,\n allNumbers,\n formatNumber,\n charCount,\n getNumberOfDigitsToShow,\n fraction,\n isFraction,\n asFraction,\n numFraction,\n cleanNumStr,\n cleanNum,\n stripLeadingZeros,\n} from './utils.ts';\n\nimport {\n toNum,\n toString,\n isValidNum,\n isScientificStringNum,\n} from './numbers/numbers.ts';\n\nimport {\n displayNumber,\n displayNumberToFixed,\n} from './numbers/display-number.ts';\n\nimport {\n round,\n roundToFixed,\n roundToPrecision,\n roundToDecimalPrecision,\n roundByMagnitude,\n roundByMagnitudeToFixed,\n roundByRange,\n} from './rounding/rounding.ts';\n\nimport {\n isCloseTo,\n isDeepCloseTo,\n isCloseToOrLessThan,\n isCloseToOrGreaterThan,\n} from './comparison/comparison.ts';\n\nexport {\n // Units\n label,\n showAltUnitsList,\n getAltUnitsListByQuantity,\n getUnitsForQuantity,\n getQuantities,\n checkAndCleanDecimalComma,\n unitFromKey,\n unitFromQuantity,\n to,\n split,\n unum,\n toBase,\n altUnitsList,\n convertTable,\n roundNumberWithLabel,\n withUnit,\n unumWithUnit,\n validateAndClean,\n isValueWithUnit,\n getValue,\n getUnit,\n convertSamePrecision,\n convertAndGetValue,\n convertAndGetValueStrict,\n withPrettyUnitLabel,\n validateNumber,\n //Rounding\n round,\n roundToFixed,\n roundToPrecision,\n roundToDecimalPrecision,\n roundByMagnitude,\n roundByMagnitudeToFixed,\n roundByRange,\n //Comparison\n isCloseTo,\n isDeepCloseTo,\n isCloseToOrLessThan,\n isCloseToOrGreaterThan,\n // Utils\n isNumeric,\n isNonNumerical,\n isEmptyValueWithUnit,\n allNumbers,\n formatNumber,\n displayNumber,\n displayNumberToFixed,\n charCount,\n getNumberOfDigitsToShow,\n fraction,\n isFraction,\n asFraction,\n numFraction,\n cleanNumStr,\n cleanNum,\n toNum,\n toString,\n isValidNum,\n isScientificStringNum,\n stripLeadingZeros,\n // Constants\n ALT_UNITS,\n LABELS,\n UNIT_FROM_KEY,\n KNOWN_CONVERSIONS,\n DEPRECATED_UNITS,\n UNIT_ALIASES,\n INTERMEDIATE_CONVERSIONS,\n KNOWN_UNITS,\n QUANTITIES_DESCRIPTION,\n UNITS_DESCRIPTION,\n};\n"],"mappings":""}
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -0,0 +1,2 @@
1
+ import { n as LocaleFormat, r as ValidateReturn, t as AltUnitWithLabel } from "./interfaces2.cjs";
2
+ export { AltUnitWithLabel, LocaleFormat, ValidateReturn };
@@ -1,16 +1,2 @@
1
- interface AltUnitWithLabel {
2
- unit: string | never;
3
- label: string | undefined;
4
- }
5
- interface LocaleFormat {
6
- thousands: string;
7
- decimal: string;
8
- useGrouping: boolean;
9
- }
10
- interface ValidateReturn {
11
- valid: boolean;
12
- errors: (string | undefined)[] | undefined;
13
- }
14
-
15
- export type { AltUnitWithLabel, LocaleFormat, ValidateReturn };
16
- //# sourceMappingURL=interfaces.d.ts.map
1
+ import { n as LocaleFormat, r as ValidateReturn, t as AltUnitWithLabel } from "./interfaces2.js";
2
+ export { AltUnitWithLabel, LocaleFormat, ValidateReturn };
@@ -1 +1 @@
1
-
1
+ export {};
@@ -0,0 +1,17 @@
1
+ //#region src/interfaces.d.ts
2
+ interface AltUnitWithLabel {
3
+ unit: string | never;
4
+ label: string | undefined;
5
+ }
6
+ interface LocaleFormat {
7
+ thousands: string;
8
+ decimal: string;
9
+ useGrouping: boolean;
10
+ }
11
+ interface ValidateReturn {
12
+ valid: boolean;
13
+ errors: (string | undefined)[] | undefined;
14
+ }
15
+ //#endregion
16
+ export { LocaleFormat as n, ValidateReturn as r, AltUnitWithLabel as t };
17
+ //# sourceMappingURL=interfaces2.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces2.d.cts","names":[],"sources":["../src/interfaces.ts"],"mappings":";UAAiB,gBAAA;EACf,IAAA;EACA,KAAA;AAAA;AAAA,UAGe,YAAA;EACf,SAAA;EACA,OAAA;EACA,WAAA;AAAA;AAAA,UAGe,cAAA;EACf,KAAA;EACA,MAAA;AAAA"}
@@ -0,0 +1,17 @@
1
+ //#region src/interfaces.d.ts
2
+ interface AltUnitWithLabel {
3
+ unit: string | never;
4
+ label: string | undefined;
5
+ }
6
+ interface LocaleFormat {
7
+ thousands: string;
8
+ decimal: string;
9
+ useGrouping: boolean;
10
+ }
11
+ interface ValidateReturn {
12
+ valid: boolean;
13
+ errors: (string | undefined)[] | undefined;
14
+ }
15
+ //#endregion
16
+ export { LocaleFormat as n, ValidateReturn as r, AltUnitWithLabel as t };
17
+ //# sourceMappingURL=interfaces2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces2.d.ts","names":[],"sources":["../src/interfaces.ts"],"mappings":";UAAiB,gBAAA;EACf,IAAA;EACA,KAAA;AAAA;AAAA,UAGe,YAAA;EACf,SAAA;EACA,OAAA;EACA,WAAA;AAAA;AAAA,UAGe,cAAA;EACf,KAAA;EACA,MAAA;AAAA"}
@@ -1,11 +1,6 @@
1
- 'use strict';
2
-
3
- var numbers_numbers = require('../units-BkI5zVBX.cjs');
4
- require('fraction.js');
5
-
6
-
7
-
8
- exports.isScientificStringNum = numbers_numbers.isScientificStringNum;
9
- exports.isValidNum = numbers_numbers.isValidNum;
10
- exports.toNum = numbers_numbers.toNum;
11
- exports.toString = numbers_numbers.toString;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_units = require("../units2.cjs");
3
+ exports.isScientificStringNum = require_units.isScientificStringNum;
4
+ exports.isValidNum = require_units.isValidNum;
5
+ exports.toNum = require_units.toNum;
6
+ exports.toString = require_units.toString;
@@ -0,0 +1,8 @@
1
+ //#region src/numbers/numbers.d.ts
2
+ declare const isValidNum: (value: unknown) => boolean;
3
+ declare const isScientificStringNum: (value: unknown) => boolean;
4
+ declare const toNum: (value: unknown, fallback?: number, minimum?: number) => any;
5
+ declare const toString: (value?: unknown) => unknown;
6
+ //#endregion
7
+ export { isScientificStringNum, isValidNum, toNum, toString };
8
+ //# sourceMappingURL=numbers.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numbers.d.cts","names":[],"sources":["../../src/numbers/numbers.ts"],"mappings":";cAgCa,UAAA,GAAc,KAAA;AAAA,cA6Dd,qBAAA,GAAyB,KAAA;AAAA,cAsBzB,KAAA,GACX,KAAA,WACA,QAAA,WACA,OAAA;AAAA,cAgCW,QAAA,GAAY,KAAA"}
@@ -1,7 +1,8 @@
1
+ //#region src/numbers/numbers.d.ts
1
2
  declare const isValidNum: (value: unknown) => boolean;
2
3
  declare const isScientificStringNum: (value: unknown) => boolean;
3
4
  declare const toNum: (value: unknown, fallback?: number, minimum?: number) => any;
4
5
  declare const toString: (value?: unknown) => unknown;
5
-
6
+ //#endregion
6
7
  export { isScientificStringNum, isValidNum, toNum, toString };
7
- //# sourceMappingURL=numbers.d.ts.map
8
+ //# sourceMappingURL=numbers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.d.ts","sources":["../../src/numbers/numbers.ts"],"mappings":"QAgCO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,OAyC3C,CAAC;QAoBK,MAAM,qBAAqB,GAAI,OAAO,OAAO,YAKnD,CAAC;QAiBK,MAAM,KAAK,GAChB,OAAO,OAAO,EACd,WAAW,MAAM,EACjB,UAAU,MAAM,KACf,GAsBF,CAAC;QASK,MAAM,QAAQ,GAAI,QAAQ,OAAO,YAkBvC,CAAC;;;;","names":[]}
1
+ {"version":3,"file":"numbers.d.ts","names":[],"sources":["../../src/numbers/numbers.ts"],"mappings":";cAgCa,UAAA,GAAc,KAAA;AAAA,cA6Dd,qBAAA,GAAyB,KAAA;AAAA,cAsBzB,KAAA,GACX,KAAA,WACA,QAAA,WACA,OAAA;AAAA,cAgCW,QAAA,GAAY,KAAA"}
@@ -1,2 +1,2 @@
1
- export { J as isScientificStringNum, M as isValidNum, a3 as toNum, a4 as toString } from '../units-DNoJOeDf.js';
2
- import 'fraction.js';
1
+ import { ft as isScientificStringNum, ht as toString, mt as toNum, pt as isValidNum } from "../units2.js";
2
+ export { isScientificStringNum, isValidNum, toNum, toString };
package/dist/units.cjs CHANGED
@@ -1,35 +1,30 @@
1
- 'use strict';
2
-
3
- var numbers_numbers = require('./units-BkI5zVBX.cjs');
4
- require('fraction.js');
5
-
6
-
7
-
8
- exports.EXP_NOTATION_RE = numbers_numbers.EXP_NOTATION_RE;
9
- exports.SEPARATOR = numbers_numbers.SEPARATOR;
10
- exports.altUnitsList = numbers_numbers.altUnitsList;
11
- exports.checkAndCleanDecimalComma = numbers_numbers.checkAndCleanDecimalComma;
12
- exports.convertAndGetValue = numbers_numbers.convertAndGetValue;
13
- exports.convertAndGetValueStrict = numbers_numbers.convertAndGetValueStrict;
14
- exports.convertSamePrecision = numbers_numbers.convertSamePrecision;
15
- exports.convertTable = numbers_numbers.convertTable;
16
- exports.getAltUnitsListByQuantity = numbers_numbers.getAltUnitsListByQuantity;
17
- exports.getQuantities = numbers_numbers.getQuantities;
18
- exports.getUnit = numbers_numbers.getUnit;
19
- exports.getUnitsForQuantity = numbers_numbers.getUnitsForQuantity;
20
- exports.getValue = numbers_numbers.getValue;
21
- exports.isValueWithUnit = numbers_numbers.isValueWithUnit;
22
- exports.label = numbers_numbers.label;
23
- exports.roundNumberWithLabel = numbers_numbers.roundNumberWithLabel;
24
- exports.showAltUnitsList = numbers_numbers.showAltUnitsList;
25
- exports.split = numbers_numbers.split;
26
- exports.to = numbers_numbers.to;
27
- exports.toBase = numbers_numbers.toBase;
28
- exports.unitFromKey = numbers_numbers.unitFromKey;
29
- exports.unitFromQuantity = numbers_numbers.unitFromQuantity;
30
- exports.unum = numbers_numbers.unum;
31
- exports.unumWithUnit = numbers_numbers.unumWithUnit;
32
- exports.validateAndClean = numbers_numbers.validateAndClean;
33
- exports.validateNumber = numbers_numbers.validateNumber;
34
- exports.withPrettyUnitLabel = numbers_numbers.withPrettyUnitLabel;
35
- exports.withUnit = numbers_numbers.withUnit;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_units = require("./units2.cjs");
3
+ exports.EXP_NOTATION_RE = require_units.EXP_NOTATION_RE;
4
+ exports.SEPARATOR = require_units.SEPARATOR;
5
+ exports.altUnitsList = require_units.altUnitsList;
6
+ exports.checkAndCleanDecimalComma = require_units.checkAndCleanDecimalComma;
7
+ exports.convertAndGetValue = require_units.convertAndGetValue;
8
+ exports.convertAndGetValueStrict = require_units.convertAndGetValueStrict;
9
+ exports.convertSamePrecision = require_units.convertSamePrecision;
10
+ exports.convertTable = require_units.convertTable;
11
+ exports.getAltUnitsListByQuantity = require_units.getAltUnitsListByQuantity;
12
+ exports.getQuantities = require_units.getQuantities;
13
+ exports.getUnit = require_units.getUnit;
14
+ exports.getUnitsForQuantity = require_units.getUnitsForQuantity;
15
+ exports.getValue = require_units.getValue;
16
+ exports.isValueWithUnit = require_units.isValueWithUnit;
17
+ exports.label = require_units.label;
18
+ exports.roundNumberWithLabel = require_units.roundNumberWithLabel;
19
+ exports.showAltUnitsList = require_units.showAltUnitsList;
20
+ exports.split = require_units.split;
21
+ exports.to = require_units.to;
22
+ exports.toBase = require_units.toBase;
23
+ exports.unitFromKey = require_units.unitFromKey;
24
+ exports.unitFromQuantity = require_units.unitFromQuantity;
25
+ exports.unum = require_units.unum;
26
+ exports.unumWithUnit = require_units.unumWithUnit;
27
+ exports.validateAndClean = require_units.validateAndClean;
28
+ exports.validateNumber = require_units.validateNumber;
29
+ exports.withPrettyUnitLabel = require_units.withPrettyUnitLabel;
30
+ exports.withUnit = require_units.withUnit;
@@ -0,0 +1,34 @@
1
+ import { r as ValidateReturn, t as AltUnitWithLabel } from "./interfaces2.cjs";
2
+
3
+ //#region src/units.d.ts
4
+ declare const SEPARATOR = "|";
5
+ declare const EXP_NOTATION_RE: RegExp;
6
+ declare function showAltUnitsList(quantityKey: string): string[] | undefined;
7
+ declare function getUnitsForQuantity(quantity: string): string[] | undefined;
8
+ declare function getQuantities(): string[] | undefined;
9
+ declare function label(unitKey: string): string | undefined;
10
+ declare function unitFromKey(quantity: string): string | undefined;
11
+ declare function unitFromQuantity(quantity: string): string | undefined;
12
+ declare function getAltUnitsListByQuantity(quantity: string): AltUnitWithLabel[] | undefined;
13
+ declare function checkAndCleanDecimalComma(val: string | number): string | number;
14
+ declare function to(value: string | number, fromUnit: string, toUnit: string): number;
15
+ declare function split(numWithUnit: string): string[];
16
+ declare function getValue(numWithUnit: string): string;
17
+ declare function getUnit(numWithUnit: string): string;
18
+ declare function unum(numWithUnit: string | number, toUnit: string, fromUnit?: string): number;
19
+ declare function isValueWithUnit(value: string | number): boolean;
20
+ declare function convertAndGetValue(numWithUnit: string | number, toUnit: string, fromUnit?: string): number;
21
+ declare function convertAndGetValueStrict(value: string | number | null, toUnit: string, fromUnit?: string): string | number | null;
22
+ declare function toBase(value: string, quantity: string): number;
23
+ declare function convertTable(toUnitRow: any, table: any, defaultUnitRow?: [], removeFinalUnitsRow?: boolean): string | number[][];
24
+ declare function roundNumberWithLabel(value: string, n?: number): string;
25
+ declare function withUnit(value: string | number | null | undefined, unit: string | null, defaultVal?: string): string;
26
+ declare function unumWithUnit(numWithUnit: string | number, toUnit: string, fromUnit?: string): string;
27
+ declare function convertSamePrecision(numWithUnit: string | number, toUnit: string, digits?: number): string;
28
+ declare function altUnitsList(value: string, quantity: string): (string | undefined)[][];
29
+ declare function validateAndClean(previousValue: string, nextText: string): string;
30
+ declare function withPrettyUnitLabel(valueWithUnits: string): string;
31
+ declare function validateNumber(value: string | number): ValidateReturn;
32
+ //#endregion
33
+ export { EXP_NOTATION_RE, SEPARATOR, altUnitsList, checkAndCleanDecimalComma, convertAndGetValue, convertAndGetValueStrict, convertSamePrecision, convertTable, getAltUnitsListByQuantity, getQuantities, getUnit, getUnitsForQuantity, getValue, isValueWithUnit, label, roundNumberWithLabel, showAltUnitsList, split, to, toBase, unitFromKey, unitFromQuantity, unum, unumWithUnit, validateAndClean, validateNumber, withPrettyUnitLabel, withUnit };
34
+ //# sourceMappingURL=units.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"units.d.cts","names":[],"sources":["../src/units.ts"],"mappings":";;;cA0Ba,SAAA;AAAA,cAEA,eAAA,EAAe,MAAA;AAAA,iBASZ,gBAAA,CAAiB,WAAA;AAAA,iBAUjB,mBAAA,CAAoB,QAAA;AAAA,iBAQpB,aAAA,CAAA;AAAA,iBAUA,KAAA,CAAM,OAAA;AAAA,iBAUN,WAAA,CAAY,QAAA;AAAA,iBAUZ,gBAAA,CAAiB,QAAA;AAAA,iBAUjB,yBAAA,CACd,QAAA,WACC,gBAAA;AAAA,iBAca,yBAAA,CACd,GAAA;AAAA,iBAqBc,EAAA,CACd,KAAA,mBACA,QAAA,UACA,MAAA;AAAA,iBAqFc,KAAA,CAAM,WAAA;AAAA,iBA+BN,QAAA,CAAS,WAAA;AAAA,iBAST,OAAA,CAAQ,WAAA;AAAA,iBAWR,IAAA,CACd,WAAA,mBACA,MAAA,UACA,QAAA;AAAA,iBAsDc,eAAA,CAAgB,KAAA;AAAA,iBAehB,kBAAA,CACd,WAAA,mBACA,MAAA,UACA,QAAA;AAAA,iBAac,wBAAA,CACd,KAAA,0BACA,MAAA,UACA,QAAA;AAAA,iBAwBc,MAAA,CAAO,KAAA,UAAe,QAAA;AAAA,iBAoBtB,YAAA,CACd,SAAA,OACA,KAAA,OACA,cAAA,OACA,mBAAA;AAAA,iBAgDc,oBAAA,CAAqB,KAAA,UAAe,CAAA;AAAA,iBAYpC,QAAA,CACd,KAAA,sCACA,IAAA,iBACA,UAAA;AAAA,iBA2Bc,YAAA,CACd,WAAA,mBACA,MAAA,UACA,QAAA;AAAA,iBAcc,oBAAA,CACd,WAAA,mBACA,MAAA,UACA,MAAA;AAAA,iBAsDc,YAAA,CACd,KAAA,UACA,QAAA;AAAA,iBAuBc,gBAAA,CACd,aAAA,UACA,QAAA;AAAA,iBA0Cc,mBAAA,CAAoB,cAAA;AAAA,iBAMpB,cAAA,CAAe,KAAA,oBAAyB,cAAA"}
package/dist/units.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { AltUnitWithLabel, ValidateReturn } from './interfaces.js';
1
+ import { r as ValidateReturn, t as AltUnitWithLabel } from "./interfaces2.js";
2
2
 
3
+ //#region src/units.d.ts
3
4
  declare const SEPARATOR = "|";
4
5
  declare const EXP_NOTATION_RE: RegExp;
5
6
  declare function showAltUnitsList(quantityKey: string): string[] | undefined;
@@ -28,6 +29,6 @@ declare function altUnitsList(value: string, quantity: string): (string | undefi
28
29
  declare function validateAndClean(previousValue: string, nextText: string): string;
29
30
  declare function withPrettyUnitLabel(valueWithUnits: string): string;
30
31
  declare function validateNumber(value: string | number): ValidateReturn;
31
-
32
+ //#endregion
32
33
  export { EXP_NOTATION_RE, SEPARATOR, altUnitsList, checkAndCleanDecimalComma, convertAndGetValue, convertAndGetValueStrict, convertSamePrecision, convertTable, getAltUnitsListByQuantity, getQuantities, getUnit, getUnitsForQuantity, getValue, isValueWithUnit, label, roundNumberWithLabel, showAltUnitsList, split, to, toBase, unitFromKey, unitFromQuantity, unum, unumWithUnit, validateAndClean, validateNumber, withPrettyUnitLabel, withUnit };
33
- //# sourceMappingURL=units.d.ts.map
34
+ //# sourceMappingURL=units.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"units.d.ts","sources":["../src/units.ts"],"mappings":";;QA0BO,MAAM,SAAS,MAAM,CAAC;QAEtB,MAAM,eAAe,QACwC,CAAC;iBAQrD,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAE1E;iBAQe,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAE1E;iBAMe,aAAa,IAAI,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CAAY,QAAA;AAAA,iBAUZ,gBAAA,CAAiB,QAAA;AAAA,iBAUjB,yBAAA,CACd,QAAA,WACC,gBAAA;AAAA,iBAca,yBAAA,CACd,GAAA;AAAA,iBAqBc,EAAA,CACd,KAAA,mBACA,QAAA,UACA,MAAA;AAAA,iBAqFc,KAAA,CAAM,WAAA;AAAA,iBA+BN,QAAA,CAAS,WAAA;AAAA,iBAST,OAAA,CAAQ,WAAA;AAAA,iBAWR,IAAA,CACd,WAAA,mBACA,MAAA,UACA,QAAA;AAAA,iBAsDc,eAAA,CAAgB,KAAA;AAAA,iBAehB,kBAAA,CACd,WAAA,mBACA,MAAA,UACA,QAAA;AAAA,iBAac,wBAAA,CACd,KAAA,0BACA,MAAA,UACA,QAAA;AAAA,iBAwBc,MAAA,CAAO,KAAA,UAAe,QAAA;AAAA,iBAoBtB,YAAA,CACd,SAAA,OACA,KAAA,OACA,cAAA,OACA,mBAAA;AAAA,iBAgDc,oBAAA,CAAqB,KAAA,UAAe,CAAA;AAAA,iBAYpC,QAAA,CACd,KAAA,sCACA,IAAA,iBACA,UAAA;AAAA,iBA2Bc,YAAA,CACd,WAAA,mBACA,MAAA,UACA,QAAA;AAAA,iBAcc,oBAAA,CACd,WAAA,mBACA,MAAA,UACA,MAAA;AAAA,iBAsDc,YAAA,CACd,KAAA,UACA,QAAA;AAAA,iBAuBc,gBAAA,CACd,aAAA,UACA,QAAA;AAAA,iBA0Cc,mBAAA,CAAoB,cAAA;AAAA,iBAMpB,cAAA,CAAe,KAAA,oBAAyB,cAAA"}
package/dist/units.js CHANGED
@@ -1,2 +1,2 @@
1
- export { ad as EXP_NOTATION_RE, ae as SEPARATOR, e as altUnitsList, h as checkAndCleanDecimalComma, k as convertAndGetValue, l as convertAndGetValueStrict, m as convertSamePrecision, n as convertTable, s as getAltUnitsListByQuantity, u as getQuantities, v as getUnit, w as getUnitsForQuantity, x as getValue, N as isValueWithUnit, O as label, W as roundNumberWithLabel, _ as showAltUnitsList, $ as split, a1 as to, a2 as toBase, a5 as unitFromKey, a6 as unitFromQuantity, a7 as unum, a8 as unumWithUnit, a9 as validateAndClean, aa as validateNumber, ab as withPrettyUnitLabel, ac as withUnit } from './units-DNoJOeDf.js';
2
- import 'fraction.js';
1
+ import { C as unum, D as withPrettyUnitLabel, E as validateNumber, O as withUnit, S as unitFromQuantity, T as validateAndClean, _ as showAltUnitsList, a as convertAndGetValue, b as toBase, c as convertTable, d as getUnit, f as getUnitsForQuantity, g as roundNumberWithLabel, h as label, i as checkAndCleanDecimalComma, l as getAltUnitsListByQuantity, m as isValueWithUnit, n as SEPARATOR, o as convertAndGetValueStrict, p as getValue, r as altUnitsList, s as convertSamePrecision, t as EXP_NOTATION_RE, u as getQuantities, v as split, w as unumWithUnit, x as unitFromKey, y as to } from "./units2.js";
2
+ export { EXP_NOTATION_RE, SEPARATOR, altUnitsList, checkAndCleanDecimalComma, convertAndGetValue, convertAndGetValueStrict, convertSamePrecision, convertTable, getAltUnitsListByQuantity, getQuantities, getUnit, getUnitsForQuantity, getValue, isValueWithUnit, label, roundNumberWithLabel, showAltUnitsList, split, to, toBase, unitFromKey, unitFromQuantity, unum, unumWithUnit, validateAndClean, validateNumber, withPrettyUnitLabel, withUnit };