@oliasoft-open-source/units 4.3.0-beta-2 → 4.3.0-beta-3
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 +70 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Fraction = require('fraction.js');
|
|
2
4
|
|
|
3
5
|
const options = { maximumFractionDigits: 20 };
|
|
4
6
|
function convertNumberToLocale(number, countryCode) {
|
|
@@ -2511,4 +2513,70 @@ function validateNumber(value) {
|
|
|
2511
2513
|
return { valid, errors: transformErrors(numberSchemaValidator.errors) };
|
|
2512
2514
|
}
|
|
2513
2515
|
|
|
2514
|
-
|
|
2516
|
+
exports.ALT_UNITS = ALT_UNITS;
|
|
2517
|
+
exports.DEPRECATED_UNITS = DEPRECATED_UNITS;
|
|
2518
|
+
exports.INTERMEDIATE_CONVERSIONS = INTERMEDIATE_CONVERSIONS;
|
|
2519
|
+
exports.KNOWN_CONVERSIONS = KNOWN_CONVERSIONS;
|
|
2520
|
+
exports.KNOWN_UNITS = KNOWN_UNITS;
|
|
2521
|
+
exports.LABELS = LABELS;
|
|
2522
|
+
exports.QUANTITIES_DESCRIPTION = QUANTITIES_DESCRIPTION;
|
|
2523
|
+
exports.UNITS_DESCRIPTION = UNITS_DESCRIPTION;
|
|
2524
|
+
exports.UNIT_ALIASES = UNIT_ALIASES;
|
|
2525
|
+
exports.UNIT_FROM_KEY = UNIT_FROM_KEY;
|
|
2526
|
+
exports.allNumbers = allNumbers;
|
|
2527
|
+
exports.altUnitsList = altUnitsList;
|
|
2528
|
+
exports.asFraction = asFraction;
|
|
2529
|
+
exports.charCount = charCount;
|
|
2530
|
+
exports.checkAndCleanDecimalComma = checkAndCleanDecimalComma;
|
|
2531
|
+
exports.cleanNum = cleanNum;
|
|
2532
|
+
exports.cleanNumStr = cleanNumStr;
|
|
2533
|
+
exports.convertAndGetValue = convertAndGetValue;
|
|
2534
|
+
exports.convertAndGetValueStrict = convertAndGetValueStrict;
|
|
2535
|
+
exports.convertSamePrecision = convertSamePrecision;
|
|
2536
|
+
exports.convertTable = convertTable;
|
|
2537
|
+
exports.displayNumber = displayNumber;
|
|
2538
|
+
exports.displayNumberToFixed = displayNumberToFixed;
|
|
2539
|
+
exports.formatNumber = formatNumber;
|
|
2540
|
+
exports.fraction = fraction;
|
|
2541
|
+
exports.getAltUnitsListByQuantity = getAltUnitsListByQuantity;
|
|
2542
|
+
exports.getNumberOfDigitsToShow = getNumberOfDigitsToShow;
|
|
2543
|
+
exports.getQuantities = getQuantities;
|
|
2544
|
+
exports.getUnit = getUnit;
|
|
2545
|
+
exports.getUnitsForQuantity = getUnitsForQuantity;
|
|
2546
|
+
exports.getValue = getValue;
|
|
2547
|
+
exports.isCloseTo = isCloseTo;
|
|
2548
|
+
exports.isCloseToOrGreaterThan = isCloseToOrGreaterThan;
|
|
2549
|
+
exports.isCloseToOrLessThan = isCloseToOrLessThan;
|
|
2550
|
+
exports.isDeepCloseTo = isDeepCloseTo;
|
|
2551
|
+
exports.isEmptyValueWithUnit = isEmptyValueWithUnit;
|
|
2552
|
+
exports.isFraction = isFraction;
|
|
2553
|
+
exports.isNonNumerical = isNonNumerical;
|
|
2554
|
+
exports.isNumeric = isNumeric;
|
|
2555
|
+
exports.isScientificStringNum = isScientificStringNum;
|
|
2556
|
+
exports.isValidNum = isValidNum;
|
|
2557
|
+
exports.isValueWithUnit = isValueWithUnit;
|
|
2558
|
+
exports.label = label;
|
|
2559
|
+
exports.numFraction = numFraction;
|
|
2560
|
+
exports.round = round;
|
|
2561
|
+
exports.roundByMagnitude = roundByMagnitude;
|
|
2562
|
+
exports.roundByMagnitudeToFixed = roundByMagnitudeToFixed;
|
|
2563
|
+
exports.roundByRange = roundByRange;
|
|
2564
|
+
exports.roundNumberWithLabel = roundNumberWithLabel;
|
|
2565
|
+
exports.roundToDecimalPrecision = roundToDecimalPrecision;
|
|
2566
|
+
exports.roundToFixed = roundToFixed;
|
|
2567
|
+
exports.roundToPrecision = roundToPrecision;
|
|
2568
|
+
exports.showAltUnitsList = showAltUnitsList;
|
|
2569
|
+
exports.split = split;
|
|
2570
|
+
exports.stripLeadingZeros = stripLeadingZeros;
|
|
2571
|
+
exports.to = to;
|
|
2572
|
+
exports.toBase = toBase;
|
|
2573
|
+
exports.toNum = toNum;
|
|
2574
|
+
exports.toString = toString;
|
|
2575
|
+
exports.unitFromKey = unitFromKey;
|
|
2576
|
+
exports.unitFromQuantity = unitFromQuantity;
|
|
2577
|
+
exports.unum = unum;
|
|
2578
|
+
exports.unumWithUnit = unumWithUnit;
|
|
2579
|
+
exports.validateAndClean = validateAndClean;
|
|
2580
|
+
exports.validateNumber = validateNumber;
|
|
2581
|
+
exports.withPrettyUnitLabel = withPrettyUnitLabel;
|
|
2582
|
+
exports.withUnit = withUnit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/units",
|
|
3
|
-
"version": "4.3.0-beta-
|
|
3
|
+
"version": "4.3.0-beta-3",
|
|
4
4
|
"description": "Package for units management",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"type": "module",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"compile-validators:build": "esbuild dist/validate/ajv-validators.js --bundle --allow-overwrite --platform=node --format=cjs --outfile=dist/validate/ajv-validators.js",
|
|
20
|
-
"build": "pkgroll --clean-dist --tsconfig=tsconfig.build.json && cp
|
|
20
|
+
"build": "pkgroll --clean-dist --tsconfig=tsconfig.build.json && cp README.md dist/",
|
|
21
21
|
"lint": "eslint . --fix",
|
|
22
22
|
"start": "yarn link && yarn compile-validators && tsx watch src/index.ts",
|
|
23
23
|
"test": "yarn compile-validators && jest --coverageThreshold \"{}\"",
|