@oliasoft-open-source/units 5.9.0 → 5.10.0
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/dist/index.cjs +3003 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +64 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2932 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -67
- package/dist/chunks/conversion.cjs +0 -3291
- package/dist/chunks/conversion.cjs.map +0 -1
- package/dist/chunks/conversion.js +0 -2901
- package/dist/chunks/conversion.js.map +0 -1
- package/dist/chunks/types.d.cts +0 -17
- package/dist/chunks/types.d.cts.map +0 -1
- package/dist/chunks/types.d.ts +0 -17
- package/dist/chunks/types.d.ts.map +0 -1
- package/dist/chunks/units.cjs +0 -55
- package/dist/chunks/units.cjs.map +0 -1
- package/dist/chunks/units.d.cts +0 -47
- package/dist/chunks/units.d.cts.map +0 -1
- package/dist/chunks/units.d.ts +0 -47
- package/dist/chunks/units.d.ts.map +0 -1
- package/dist/chunks/units.js +0 -38
- package/dist/chunks/units.js.map +0 -1
- package/dist/interfaces.cjs +0 -0
- package/dist/interfaces.d.cts +0 -2
- package/dist/interfaces.d.ts +0 -2
- package/dist/interfaces.js +0 -1
- package/dist/numbers/numbers.cjs +0 -6
- package/dist/numbers/numbers.d.cts +0 -8
- package/dist/numbers/numbers.d.cts.map +0 -1
- package/dist/numbers/numbers.d.ts +0 -8
- package/dist/numbers/numbers.d.ts.map +0 -1
- package/dist/numbers/numbers.js +0 -2
- package/dist/units.cjs +0 -31
- package/dist/units.d.cts +0 -2
- package/dist/units.d.ts +0 -2
- package/dist/units.js +0 -3
package/dist/chunks/units.d.cts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { r as ValidateReturn, t as AltUnitWithLabel } from "./types.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/units/unit-catalog.d.ts
|
|
4
|
-
declare function showAltUnitsList(quantityKey: string): string[] | undefined;
|
|
5
|
-
declare function getUnitsForQuantity(quantity: string): string[] | undefined;
|
|
6
|
-
declare function getQuantities(): string[] | undefined;
|
|
7
|
-
declare function label(unitKey: string): string | undefined;
|
|
8
|
-
declare function unitFromKey(quantity: string): string | undefined;
|
|
9
|
-
declare function unitFromQuantity(quantity: string): string | undefined;
|
|
10
|
-
declare function getAltUnitsListByQuantity(quantity: string): AltUnitWithLabel[] | undefined;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/units/unit-string.d.ts
|
|
13
|
-
declare const SEPARATOR = "|";
|
|
14
|
-
declare function isEmptyValueWithUnit(value: string | number): boolean;
|
|
15
|
-
declare function split(valueWithUnit: string): string[];
|
|
16
|
-
declare function getValue(valueWithUnit: string): string;
|
|
17
|
-
declare function getUnit(valueWithUnit: string): string;
|
|
18
|
-
declare function isValueWithUnit(value: string | number): boolean;
|
|
19
|
-
declare function withUnit(value: string | number | null | undefined, unit: string | null, defaultValue?: string): string;
|
|
20
|
-
declare function withPrettyUnitLabel(valueWithUnits: string): string;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/units/conversion.d.ts
|
|
23
|
-
declare function to(value: string | number, fromUnit: string, toUnit: string): number;
|
|
24
|
-
declare function unum(valueWithUnit: string | number, toUnit: string, fromUnit?: string): number;
|
|
25
|
-
declare function convertAndGetValue(value: string | number, toUnit: string, fromUnit?: string): number;
|
|
26
|
-
declare function convertAndGetValueStrict(value: string | number | null, toUnit: string, fromUnit?: string): string | number | null;
|
|
27
|
-
declare function toBase(value: string, quantity: string): number;
|
|
28
|
-
declare function unumWithUnit(value: string | number, toUnit: string, fromUnit?: string): string;
|
|
29
|
-
declare function convertSamePrecision(valueWithUnit: string | number, toUnit: string, digits?: number): string;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/units/table-conversion.d.ts
|
|
32
|
-
declare function convertTable(toUnitRow: any, table: any, defaultUnitRow?: [], removeFinalUnitsRow?: boolean): string | number[][];
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/units/formatting.d.ts
|
|
35
|
-
declare function roundNumberWithLabel(value: string, numberOfDigits?: number): string;
|
|
36
|
-
declare function altUnitsList(value: string, quantity: string): (string | undefined)[][];
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/units/validation.d.ts
|
|
39
|
-
declare function checkAndCleanDecimalComma(value: string | number): string | number;
|
|
40
|
-
declare function validateAndClean(previousValue: string, nextText: string): string;
|
|
41
|
-
declare function validateNumber(value: string | number): ValidateReturn;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/numbers/scientific-notation/scientific-notation.d.ts
|
|
44
|
-
declare const EXP_NOTATION_RE: RegExp;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { getAltUnitsListByQuantity as C, showAltUnitsList as D, label as E, unitFromKey as O, withUnit as S, getUnitsForQuantity as T, getValue as _, altUnitsList as a, split as b, convertAndGetValue as c, to as d, toBase as f, getUnit as g, SEPARATOR as h, validateNumber as i, unitFromQuantity as k, convertAndGetValueStrict as l, unumWithUnit as m, checkAndCleanDecimalComma as n, roundNumberWithLabel as o, unum as p, validateAndClean as r, convertTable as s, EXP_NOTATION_RE as t, convertSamePrecision as u, isEmptyValueWithUnit as v, getQuantities as w, withPrettyUnitLabel as x, isValueWithUnit as y };
|
|
47
|
-
//# sourceMappingURL=units.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"units.d.cts","names":[],"sources":["../../src/units/unit-catalog.ts","../../src/units/unit-string.ts","../../src/units/conversion.ts","../../src/units/table-conversion.ts","../../src/units/formatting.ts","../../src/units/validation.ts","../../src/numbers/scientific-notation/scientific-notation.ts"],"mappings":";;;iBAIgB,gBAAA,CAAiB,WAAA;AAAA,iBAKjB,mBAAA,CAAoB,QAAA;AAAA,iBAKpB,aAAA,CAAA;AAAA,iBAKA,KAAA,CAAM,OAAA;AAAA,iBAKN,WAAA,CAAY,QAAA;AAAA,iBAKZ,gBAAA,CAAiB,QAAA;AAAA,iBAKjB,yBAAA,CAA0B,QAAA,WAAmB,gBAAA;;;cC/BhD,SAAA;AAAA,iBAKG,oBAAA,CAAqB,KAAA;AAAA,iBAKrB,KAAA,CAAM,aAAA;AAAA,iBA2BN,QAAA,CAAS,aAAA;AAAA,iBAKT,OAAA,CAAQ,aAAA;AAAA,iBAKR,eAAA,CAAgB,KAAA;AAAA,iBAShB,QAAA,CAAS,KAAA,sCAA2C,IAAA,iBAAqB,YAAA;AAAA,iBAezE,mBAAA,CAAoB,cAAA;;;iBChEpB,EAAA,CAAG,KAAA,mBAAwB,QAAA,UAAkB,MAAA;AAAA,iBA+D7C,IAAA,CAAK,aAAA,mBAAgC,MAAA,UAAgB,QAAA;AAAA,iBAoDrD,kBAAA,CAAmB,KAAA,mBAAwB,MAAA,UAAgB,QAAA;AAAA,iBAK3D,wBAAA,CACd,KAAA,0BACA,MAAA,UACA,QAAA;AAAA,iBAcc,MAAA,CAAO,KAAA,UAAe,QAAA;AAAA,iBAOtB,YAAA,CAAa,KAAA,mBAAwB,MAAA,UAAgB,QAAA;AAAA,iBAKrD,oBAAA,CAAqB,aAAA,mBAAgC,MAAA,UAAgB,MAAA;;;iBC3JrE,YAAA,CACd,SAAA,OACA,KAAA,OACA,cAAA,OACA,mBAAA;;;iBCAc,oBAAA,CAAqB,KAAA,UAAe,cAAA;AAAA,iBAKpC,YAAA,CAAa,KAAA,UAAe,QAAA;;;iBCL5B,yBAAA,CAA0B,KAAA;AAAA,iBAa1B,gBAAA,CAAiB,aAAA,UAAuB,QAAA;AAAA,iBAuBxC,cAAA,CAAe,KAAA,oBAAyB,cAAA;;;cC1C3C,eAAA,EAAe,MAAA"}
|
package/dist/chunks/units.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { r as ValidateReturn, t as AltUnitWithLabel } from "./types.js";
|
|
2
|
-
|
|
3
|
-
//#region src/units/unit-catalog.d.ts
|
|
4
|
-
declare function showAltUnitsList(quantityKey: string): string[] | undefined;
|
|
5
|
-
declare function getUnitsForQuantity(quantity: string): string[] | undefined;
|
|
6
|
-
declare function getQuantities(): string[] | undefined;
|
|
7
|
-
declare function label(unitKey: string): string | undefined;
|
|
8
|
-
declare function unitFromKey(quantity: string): string | undefined;
|
|
9
|
-
declare function unitFromQuantity(quantity: string): string | undefined;
|
|
10
|
-
declare function getAltUnitsListByQuantity(quantity: string): AltUnitWithLabel[] | undefined;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/units/unit-string.d.ts
|
|
13
|
-
declare const SEPARATOR = "|";
|
|
14
|
-
declare function isEmptyValueWithUnit(value: string | number): boolean;
|
|
15
|
-
declare function split(valueWithUnit: string): string[];
|
|
16
|
-
declare function getValue(valueWithUnit: string): string;
|
|
17
|
-
declare function getUnit(valueWithUnit: string): string;
|
|
18
|
-
declare function isValueWithUnit(value: string | number): boolean;
|
|
19
|
-
declare function withUnit(value: string | number | null | undefined, unit: string | null, defaultValue?: string): string;
|
|
20
|
-
declare function withPrettyUnitLabel(valueWithUnits: string): string;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/units/conversion.d.ts
|
|
23
|
-
declare function to(value: string | number, fromUnit: string, toUnit: string): number;
|
|
24
|
-
declare function unum(valueWithUnit: string | number, toUnit: string, fromUnit?: string): number;
|
|
25
|
-
declare function convertAndGetValue(value: string | number, toUnit: string, fromUnit?: string): number;
|
|
26
|
-
declare function convertAndGetValueStrict(value: string | number | null, toUnit: string, fromUnit?: string): string | number | null;
|
|
27
|
-
declare function toBase(value: string, quantity: string): number;
|
|
28
|
-
declare function unumWithUnit(value: string | number, toUnit: string, fromUnit?: string): string;
|
|
29
|
-
declare function convertSamePrecision(valueWithUnit: string | number, toUnit: string, digits?: number): string;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/units/table-conversion.d.ts
|
|
32
|
-
declare function convertTable(toUnitRow: any, table: any, defaultUnitRow?: [], removeFinalUnitsRow?: boolean): string | number[][];
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/units/formatting.d.ts
|
|
35
|
-
declare function roundNumberWithLabel(value: string, numberOfDigits?: number): string;
|
|
36
|
-
declare function altUnitsList(value: string, quantity: string): (string | undefined)[][];
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/units/validation.d.ts
|
|
39
|
-
declare function checkAndCleanDecimalComma(value: string | number): string | number;
|
|
40
|
-
declare function validateAndClean(previousValue: string, nextText: string): string;
|
|
41
|
-
declare function validateNumber(value: string | number): ValidateReturn;
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/numbers/scientific-notation/scientific-notation.d.ts
|
|
44
|
-
declare const EXP_NOTATION_RE: RegExp;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { getAltUnitsListByQuantity as C, showAltUnitsList as D, label as E, unitFromKey as O, withUnit as S, getUnitsForQuantity as T, getValue as _, altUnitsList as a, split as b, convertAndGetValue as c, to as d, toBase as f, getUnit as g, SEPARATOR as h, validateNumber as i, unitFromQuantity as k, convertAndGetValueStrict as l, unumWithUnit as m, checkAndCleanDecimalComma as n, roundNumberWithLabel as o, unum as p, validateAndClean as r, convertTable as s, EXP_NOTATION_RE as t, convertSamePrecision as u, isEmptyValueWithUnit as v, getQuantities as w, withPrettyUnitLabel as x, isValueWithUnit as y };
|
|
47
|
-
//# sourceMappingURL=units.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"units.d.ts","names":[],"sources":["../../src/units/unit-catalog.ts","../../src/units/unit-string.ts","../../src/units/conversion.ts","../../src/units/table-conversion.ts","../../src/units/formatting.ts","../../src/units/validation.ts","../../src/numbers/scientific-notation/scientific-notation.ts"],"mappings":";;;iBAIgB,gBAAA,CAAiB,WAAA;AAAA,iBAKjB,mBAAA,CAAoB,QAAA;AAAA,iBAKpB,aAAA,CAAA;AAAA,iBAKA,KAAA,CAAM,OAAA;AAAA,iBAKN,WAAA,CAAY,QAAA;AAAA,iBAKZ,gBAAA,CAAiB,QAAA;AAAA,iBAKjB,yBAAA,CAA0B,QAAA,WAAmB,gBAAA;;;cC/BhD,SAAA;AAAA,iBAKG,oBAAA,CAAqB,KAAA;AAAA,iBAKrB,KAAA,CAAM,aAAA;AAAA,iBA2BN,QAAA,CAAS,aAAA;AAAA,iBAKT,OAAA,CAAQ,aAAA;AAAA,iBAKR,eAAA,CAAgB,KAAA;AAAA,iBAShB,QAAA,CAAS,KAAA,sCAA2C,IAAA,iBAAqB,YAAA;AAAA,iBAezE,mBAAA,CAAoB,cAAA;;;iBChEpB,EAAA,CAAG,KAAA,mBAAwB,QAAA,UAAkB,MAAA;AAAA,iBA+D7C,IAAA,CAAK,aAAA,mBAAgC,MAAA,UAAgB,QAAA;AAAA,iBAoDrD,kBAAA,CAAmB,KAAA,mBAAwB,MAAA,UAAgB,QAAA;AAAA,iBAK3D,wBAAA,CACd,KAAA,0BACA,MAAA,UACA,QAAA;AAAA,iBAcc,MAAA,CAAO,KAAA,UAAe,QAAA;AAAA,iBAOtB,YAAA,CAAa,KAAA,mBAAwB,MAAA,UAAgB,QAAA;AAAA,iBAKrD,oBAAA,CAAqB,aAAA,mBAAgC,MAAA,UAAgB,MAAA;;;iBC3JrE,YAAA,CACd,SAAA,OACA,KAAA,OACA,cAAA,OACA,mBAAA;;;iBCAc,oBAAA,CAAqB,KAAA,UAAe,cAAA;AAAA,iBAKpC,YAAA,CAAa,KAAA,UAAe,QAAA;;;iBCL5B,yBAAA,CAA0B,KAAA;AAAA,iBAa1B,gBAAA,CAAiB,aAAA,UAAuB,QAAA;AAAA,iBAuBxC,cAAA,CAAe,KAAA,oBAAyB,cAAA;;;cC1C3C,eAAA,EAAe,MAAA"}
|
package/dist/chunks/units.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { H as split, Q as label, R as getUnit, W as withUnit, h as displayNumber, nt as ALT_UNITS, o as unum, r as convertSamePrecision, tt as unitFromQuantity, v as round } from "./conversion.js";
|
|
2
|
-
//#region src/units/table-conversion.ts
|
|
3
|
-
/** Converts every numeric column in a table to a requested unit row. */
|
|
4
|
-
function convertTable(toUnitRow, table, defaultUnitRow, removeFinalUnitsRow = false) {
|
|
5
|
-
if (!table || !table.length || !table[0].length) return table;
|
|
6
|
-
if (!toUnitRow) toUnitRow = table[0];
|
|
7
|
-
if (!defaultUnitRow) defaultUnitRow = toUnitRow;
|
|
8
|
-
const firstCell = table[0][0];
|
|
9
|
-
const firstCellParts = firstCell && split(`${firstCell}`);
|
|
10
|
-
const tableHasUnits = !(firstCellParts && firstCellParts[0] && isNaN(firstCellParts[1])) && isNaN(table[0][0]);
|
|
11
|
-
let rowIndex = tableHasUnits ? 1 : 0;
|
|
12
|
-
const fromUnitRow = tableHasUnits ? table[0] : defaultUnitRow;
|
|
13
|
-
const convertedTable = [toUnitRow];
|
|
14
|
-
for (; rowIndex < table.length; rowIndex += 1) {
|
|
15
|
-
const convertedColumns = Array(toUnitRow.length);
|
|
16
|
-
const row = table[rowIndex];
|
|
17
|
-
for (let unitIndex = 0; unitIndex < convertedColumns.length; unitIndex += 1) convertedColumns[unitIndex] = toUnitRow[unitIndex] && row[unitIndex] ? unum(row[unitIndex], toUnitRow[unitIndex], fromUnitRow[unitIndex]) : row[unitIndex];
|
|
18
|
-
convertedTable.push(convertedColumns);
|
|
19
|
-
}
|
|
20
|
-
if (removeFinalUnitsRow) convertedTable.shift();
|
|
21
|
-
return convertedTable;
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/units/formatting.ts
|
|
25
|
-
/** Rounds a unit string and replaces the unit key with its display label. */
|
|
26
|
-
function roundNumberWithLabel(value, numberOfDigits = 2) {
|
|
27
|
-
return displayNumber(round(value, numberOfDigits), { withUnit: true });
|
|
28
|
-
}
|
|
29
|
-
/** Returns a value converted to every unit configured for a quantity. */
|
|
30
|
-
function altUnitsList(value, quantity) {
|
|
31
|
-
let valueWithUnit = value;
|
|
32
|
-
if (!getUnit(value)) valueWithUnit = withUnit(value, unitFromQuantity(quantity) ?? "");
|
|
33
|
-
return (ALT_UNITS[quantity] ?? []).map((unit) => [...split(convertSamePrecision(valueWithUnit, unit)), label(unit)]);
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { roundNumberWithLabel as n, convertTable as r, altUnitsList as t };
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=units.js.map
|
package/dist/chunks/units.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"units.js","names":[],"sources":["../../src/units/table-conversion.ts","../../src/units/formatting.ts"],"sourcesContent":["import { unum } from './conversion.ts';\nimport { split } from './unit-string.ts';\n\n/** Converts every numeric column in a table to a requested unit row. */\nexport function convertTable(\n toUnitRow: any,\n table: any,\n defaultUnitRow?: [],\n removeFinalUnitsRow = false,\n): string | number[][] {\n if (!table || !table.length || !table[0].length) {\n return table;\n }\n if (!toUnitRow) {\n toUnitRow = table[0];\n }\n if (!defaultUnitRow) {\n defaultUnitRow = toUnitRow;\n }\n\n const firstCell = table[0][0];\n const firstCellParts = firstCell && split(`${firstCell}`);\n const unitNumber = firstCellParts && firstCellParts[0] && isNaN(firstCellParts[1] as unknown as number);\n const tableHasUnits = !unitNumber && isNaN(table[0][0] as unknown as number);\n let rowIndex = tableHasUnits ? 1 : 0;\n const fromUnitRow = tableHasUnits ? table[0] : defaultUnitRow;\n const convertedTable = [toUnitRow];\n for (; rowIndex < table.length; rowIndex += 1) {\n const convertedColumns = Array(toUnitRow.length);\n const row = table[rowIndex];\n for (let unitIndex = 0; unitIndex < convertedColumns.length; unitIndex += 1) {\n convertedColumns[unitIndex] =\n toUnitRow[unitIndex] && row[unitIndex]\n ? unum(row[unitIndex], toUnitRow[unitIndex], fromUnitRow[unitIndex] as string)\n : row[unitIndex];\n }\n convertedTable.push(convertedColumns);\n }\n if (removeFinalUnitsRow) {\n convertedTable.shift();\n }\n return convertedTable;\n}\n","import { ALT_UNITS } from './constants.ts';\nimport { displayNumber } from '../numbers/format/display-number.ts';\nimport { round } from '../numbers/rounding/rounding.ts';\nimport { convertSamePrecision } from './conversion.ts';\nimport { label, unitFromQuantity } from './unit-catalog.ts';\nimport { getUnit, split, withUnit } from './unit-string.ts';\n\n/** Rounds a unit string and replaces the unit key with its display label. */\nexport function roundNumberWithLabel(value: string, numberOfDigits = 2): string {\n return displayNumber(round(value, numberOfDigits), { withUnit: true });\n}\n\n/** Returns a value converted to every unit configured for a quantity. */\nexport function altUnitsList(value: string, quantity: string): (string | undefined)[][] {\n let valueWithUnit = value;\n if (!getUnit(value)) {\n valueWithUnit = withUnit(value, unitFromQuantity(quantity) ?? '');\n }\n const alternativeUnits = ALT_UNITS[quantity] ?? [];\n return alternativeUnits.map((unit: string) => [...split(convertSamePrecision(valueWithUnit, unit)), label(unit)]);\n}\n"],"mappings":";;;AAIA,SAAgB,aACd,WACA,OACA,gBACA,sBAAsB,OACD;AACrB,KAAI,CAAC,SAAS,CAAC,MAAM,UAAU,CAAC,MAAM,GAAG,OACvC,QAAO;AAET,KAAI,CAAC,UACH,aAAY,MAAM;AAEpB,KAAI,CAAC,eACH,kBAAiB;CAGnB,MAAM,YAAY,MAAM,GAAG;CAC3B,MAAM,iBAAiB,aAAa,MAAM,GAAG,YAAY;CAEzD,MAAM,gBAAgB,EADH,kBAAkB,eAAe,MAAM,MAAM,eAAe,GAAwB,KAClE,MAAM,MAAM,GAAG,GAAwB;CAC5E,IAAI,WAAW,gBAAgB,IAAI;CACnC,MAAM,cAAc,gBAAgB,MAAM,KAAK;CAC/C,MAAM,iBAAiB,CAAC,UAAU;AAClC,QAAO,WAAW,MAAM,QAAQ,YAAY,GAAG;EAC7C,MAAM,mBAAmB,MAAM,UAAU,OAAO;EAChD,MAAM,MAAM,MAAM;AAClB,OAAK,IAAI,YAAY,GAAG,YAAY,iBAAiB,QAAQ,aAAa,EACxE,kBAAiB,aACf,UAAU,cAAc,IAAI,aACxB,KAAK,IAAI,YAAY,UAAU,YAAY,YAAY,WAAqB,GAC5E,IAAI;AAEZ,iBAAe,KAAK,iBAAiB;;AAEvC,KAAI,oBACF,gBAAe,OAAO;AAExB,QAAO;;;;;ACjCT,SAAgB,qBAAqB,OAAe,iBAAiB,GAAW;AAC9E,QAAO,cAAc,MAAM,OAAO,eAAe,EAAE,EAAE,UAAU,MAAM,CAAC;;;AAIxE,SAAgB,aAAa,OAAe,UAA4C;CACtF,IAAI,gBAAgB;AACpB,KAAI,CAAC,QAAQ,MAAM,CACjB,iBAAgB,SAAS,OAAO,iBAAiB,SAAS,IAAI,GAAG;AAGnE,SADyB,UAAU,aAAa,EAAE,EAC1B,KAAK,SAAiB,CAAC,GAAG,MAAM,qBAAqB,eAAe,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,CAAC"}
|
package/dist/interfaces.cjs
DELETED
|
File without changes
|
package/dist/interfaces.d.cts
DELETED
package/dist/interfaces.d.ts
DELETED
package/dist/interfaces.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/numbers/numbers.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_conversion = require("../chunks/conversion.cjs");
|
|
3
|
-
exports.isScientificStringNum = require_conversion.isScientificStringNum;
|
|
4
|
-
exports.isValidNum = require_conversion.isValidNum;
|
|
5
|
-
exports.toNum = require_conversion.toNum;
|
|
6
|
-
exports.toString = require_conversion.toString;
|
|
@@ -1,8 +0,0 @@
|
|
|
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) => any;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { isScientificStringNum, isValidNum, toNum, toString };
|
|
8
|
-
//# sourceMappingURL=numbers.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.d.cts","names":[],"sources":["../../src/numbers/numbers.ts"],"mappings":";cA+Ba,UAAA,GAAc,KAAA;AAAA,cA6Dd,qBAAA,GAAyB,KAAA;AAAA,cAsBzB,KAAA,GAAS,KAAA,WAAgB,QAAA,WAAmB,OAAA;AAAA,cA+B5C,QAAA,GAAY,KAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
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) => any;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { isScientificStringNum, isValidNum, toNum, toString };
|
|
8
|
-
//# sourceMappingURL=numbers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.d.ts","names":[],"sources":["../../src/numbers/numbers.ts"],"mappings":";cA+Ba,UAAA,GAAc,KAAA;AAAA,cA6Dd,qBAAA,GAAyB,KAAA;AAAA,cAsBzB,KAAA,GAAS,KAAA,WAAgB,QAAA,WAAmB,OAAA;AAAA,cA+B5C,QAAA,GAAY,KAAA"}
|
package/dist/numbers/numbers.js
DELETED
package/dist/units.cjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_conversion = require("./chunks/conversion.cjs");
|
|
3
|
-
const require_units = require("./chunks/units.cjs");
|
|
4
|
-
exports.EXP_NOTATION_RE = require_conversion.EXP_NOTATION_RE;
|
|
5
|
-
exports.SEPARATOR = require_conversion.SEPARATOR;
|
|
6
|
-
exports.altUnitsList = require_units.altUnitsList;
|
|
7
|
-
exports.checkAndCleanDecimalComma = require_conversion.checkAndCleanDecimalComma;
|
|
8
|
-
exports.convertAndGetValue = require_conversion.convertAndGetValue;
|
|
9
|
-
exports.convertAndGetValueStrict = require_conversion.convertAndGetValueStrict;
|
|
10
|
-
exports.convertSamePrecision = require_conversion.convertSamePrecision;
|
|
11
|
-
exports.convertTable = require_units.convertTable;
|
|
12
|
-
exports.getAltUnitsListByQuantity = require_conversion.getAltUnitsListByQuantity;
|
|
13
|
-
exports.getQuantities = require_conversion.getQuantities;
|
|
14
|
-
exports.getUnit = require_conversion.getUnit;
|
|
15
|
-
exports.getUnitsForQuantity = require_conversion.getUnitsForQuantity;
|
|
16
|
-
exports.getValue = require_conversion.getValue;
|
|
17
|
-
exports.isValueWithUnit = require_conversion.isValueWithUnit;
|
|
18
|
-
exports.label = require_conversion.label;
|
|
19
|
-
exports.roundNumberWithLabel = require_units.roundNumberWithLabel;
|
|
20
|
-
exports.showAltUnitsList = require_conversion.showAltUnitsList;
|
|
21
|
-
exports.split = require_conversion.split;
|
|
22
|
-
exports.to = require_conversion.to;
|
|
23
|
-
exports.toBase = require_conversion.toBase;
|
|
24
|
-
exports.unitFromKey = require_conversion.unitFromKey;
|
|
25
|
-
exports.unitFromQuantity = require_conversion.unitFromQuantity;
|
|
26
|
-
exports.unum = require_conversion.unum;
|
|
27
|
-
exports.unumWithUnit = require_conversion.unumWithUnit;
|
|
28
|
-
exports.validateAndClean = require_conversion.validateAndClean;
|
|
29
|
-
exports.validateNumber = require_conversion.validateNumber;
|
|
30
|
-
exports.withPrettyUnitLabel = require_conversion.withPrettyUnitLabel;
|
|
31
|
-
exports.withUnit = require_conversion.withUnit;
|
package/dist/units.d.cts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { C as getAltUnitsListByQuantity, D as showAltUnitsList, E as label, O as unitFromKey, S as withUnit, T as getUnitsForQuantity, _ as getValue, a as altUnitsList, b as split, c as convertAndGetValue, d as to, f as toBase, g as getUnit, h as SEPARATOR, i as validateNumber, k as unitFromQuantity, l as convertAndGetValueStrict, m as unumWithUnit, n as checkAndCleanDecimalComma, o as roundNumberWithLabel, p as unum, r as validateAndClean, s as convertTable, t as EXP_NOTATION_RE, u as convertSamePrecision, w as getQuantities, x as withPrettyUnitLabel, y as isValueWithUnit } from "./chunks/units.cjs";
|
|
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 };
|
package/dist/units.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { C as getAltUnitsListByQuantity, D as showAltUnitsList, E as label, O as unitFromKey, S as withUnit, T as getUnitsForQuantity, _ as getValue, a as altUnitsList, b as split, c as convertAndGetValue, d as to, f as toBase, g as getUnit, h as SEPARATOR, i as validateNumber, k as unitFromQuantity, l as convertAndGetValueStrict, m as unumWithUnit, n as checkAndCleanDecimalComma, o as roundNumberWithLabel, p as unum, r as validateAndClean, s as convertTable, t as EXP_NOTATION_RE, u as convertSamePrecision, w as getQuantities, x as withPrettyUnitLabel, y as isValueWithUnit } from "./chunks/units.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 };
|
package/dist/units.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { $ as showAltUnitsList, H as split, L as SEPARATOR, M as EXP_NOTATION_RE, Q as label, R as getUnit, U as withPrettyUnitLabel, V as isValueWithUnit, W as withUnit, X as getQuantities, Y as getAltUnitsListByQuantity, Z as getUnitsForQuantity, a as toBase, c as checkAndCleanDecimalComma, et as unitFromKey, i as to, l as validateAndClean, n as convertAndGetValueStrict, o as unum, r as convertSamePrecision, s as unumWithUnit, t as convertAndGetValue, tt as unitFromQuantity, u as validateNumber, z as getValue } from "./chunks/conversion.js";
|
|
2
|
-
import { n as roundNumberWithLabel, r as convertTable, t as altUnitsList } from "./chunks/units.js";
|
|
3
|
-
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 };
|