@oliasoft-open-source/units 4.3.1 → 4.3.2-beta-2
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 +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/numbers/numbers.cjs +1 -1
- package/dist/numbers/numbers.js +1 -1
- package/dist/{units-8OgTPpkQ.cjs → units-BHUINFsv.cjs} +23 -2
- package/dist/{units-eowpZ327.js → units-BvWnXAYk.js} +23 -2
- package/dist/units.cjs +1 -1
- package/dist/units.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a3 as ALT_UNITS, a7 as DEPRECATED_UNITS, a9 as INTERMEDIATE_CONVERSIONS, a6 as KNOWN_CONVERSIONS, aa as KNOWN_UNITS, a4 as LABELS, ab as QUANTITIES_DESCRIPTION, ac as UNITS_DESCRIPTION, a8 as UNIT_ALIASES, a5 as UNIT_FROM_KEY, O as allNumbers, i as altUnitsList, W as asFraction, S as charCount, c as checkAndCleanDecimalComma, Z as cleanNum, Y as cleanNumStr, q as convertAndGetValue, x as convertAndGetValueStrict, p as convertSamePrecision, j as convertTable, Q as displayNumber, R as displayNumberToFixed, P as formatNumber, U as fraction, g as getAltUnitsListByQuantity, T as getNumberOfDigitsToShow, b as getQuantities, o as getUnit, a as getUnitsForQuantity, n as getValue, H as isCloseTo, K as isCloseToOrGreaterThan, J as isCloseToOrLessThan, I as isDeepCloseTo, N as isEmptyValueWithUnit, V as isFraction, M as isNonNumerical, L as isNumeric, a1 as isScientificStringNum, a0 as isValidNum, m as isValueWithUnit, l as label, X as numFraction, A as round, E as roundByMagnitude, F as roundByMagnitudeToFixed, G as roundByRange, r as roundNumberWithLabel, D as roundToDecimalPrecision, B as roundToFixed, C as roundToPrecision, s as showAltUnitsList, e as split, a2 as stripLeadingZeros, t as to, h as toBase, _ as toNum, $ as toString, u as unitFromKey, d as unitFromQuantity, f as unum, k as unumWithUnit, v as validateAndClean, z as validateNumber, y as withPrettyUnitLabel, w as withUnit } from './units-
|
|
1
|
+
export { a3 as ALT_UNITS, a7 as DEPRECATED_UNITS, a9 as INTERMEDIATE_CONVERSIONS, a6 as KNOWN_CONVERSIONS, aa as KNOWN_UNITS, a4 as LABELS, ab as QUANTITIES_DESCRIPTION, ac as UNITS_DESCRIPTION, a8 as UNIT_ALIASES, a5 as UNIT_FROM_KEY, O as allNumbers, i as altUnitsList, W as asFraction, S as charCount, c as checkAndCleanDecimalComma, Z as cleanNum, Y as cleanNumStr, q as convertAndGetValue, x as convertAndGetValueStrict, p as convertSamePrecision, j as convertTable, Q as displayNumber, R as displayNumberToFixed, P as formatNumber, U as fraction, g as getAltUnitsListByQuantity, T as getNumberOfDigitsToShow, b as getQuantities, o as getUnit, a as getUnitsForQuantity, n as getValue, H as isCloseTo, K as isCloseToOrGreaterThan, J as isCloseToOrLessThan, I as isDeepCloseTo, N as isEmptyValueWithUnit, V as isFraction, M as isNonNumerical, L as isNumeric, a1 as isScientificStringNum, a0 as isValidNum, m as isValueWithUnit, l as label, X as numFraction, A as round, E as roundByMagnitude, F as roundByMagnitudeToFixed, G as roundByRange, r as roundNumberWithLabel, D as roundToDecimalPrecision, B as roundToFixed, C as roundToPrecision, s as showAltUnitsList, e as split, a2 as stripLeadingZeros, t as to, h as toBase, _ as toNum, $ as toString, u as unitFromKey, d as unitFromQuantity, f as unum, k as unumWithUnit, v as validateAndClean, z as validateNumber, y as withPrettyUnitLabel, w as withUnit } from './units-BvWnXAYk.js';
|
|
2
2
|
import 'fraction.js';
|
package/dist/numbers/numbers.cjs
CHANGED
package/dist/numbers/numbers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a1 as isScientificStringNum, a0 as isValidNum, _ as toNum, $ as toString } from '../units-
|
|
1
|
+
export { a1 as isScientificStringNum, a0 as isValidNum, _ as toNum, $ as toString } from '../units-BvWnXAYk.js';
|
|
2
2
|
import 'fraction.js';
|
|
@@ -857,6 +857,9 @@ const LABELS = Object.freeze({
|
|
|
857
857
|
mph: "mph",
|
|
858
858
|
"km/h": "km/h",
|
|
859
859
|
"m/s2": "m/s\xB2",
|
|
860
|
+
"Gs": "Gs",
|
|
861
|
+
"nT": "nT",
|
|
862
|
+
"g": "g",
|
|
860
863
|
"ft/s2": "ft/s\xB2",
|
|
861
864
|
"Pa*s": "Pa\u22C5s",
|
|
862
865
|
P: "P",
|
|
@@ -1062,6 +1065,8 @@ const ALT_UNITS = Object.freeze({
|
|
|
1062
1065
|
wearFactor: ["E-09/bar", "E-10/psi", "E-14/pa"],
|
|
1063
1066
|
volumeGradient: ["m3/m", "cm3/m", "mm3/m", "ft3/ft", "in3/ft"],
|
|
1064
1067
|
shearStress: ["Pa", "lbf/100ft2"],
|
|
1068
|
+
sensorAccelerometer: ["g", "m/s2"],
|
|
1069
|
+
sensorMagnetometer: ["Gs", "nT"],
|
|
1065
1070
|
location: ["lk", "ftCla", "lkCla", "ftSe", "ydSe", "chSe", "chSe(T)", "ftGC", "ydInd", "ft", "m", "usft"],
|
|
1066
1071
|
mixingRequirements: ["m3/t", "L/100kg"],
|
|
1067
1072
|
entalphy: ["J/kg", "kJ/kg", "BTU/lbm"]
|
|
@@ -1119,7 +1124,9 @@ const UNIT_FROM_KEY = Object.freeze({
|
|
|
1119
1124
|
mixingRequirements: "m3/t",
|
|
1120
1125
|
entalphy: "J/kg",
|
|
1121
1126
|
shearStress: "Pa",
|
|
1122
|
-
volumeGradient: "m3/m"
|
|
1127
|
+
volumeGradient: "m3/m",
|
|
1128
|
+
sensorAccelerometer: "g",
|
|
1129
|
+
sensorMagnetometer: "Gs"
|
|
1123
1130
|
});
|
|
1124
1131
|
const C = Object.freeze({
|
|
1125
1132
|
g: 0.0980665175317196,
|
|
@@ -1625,6 +1632,12 @@ const KNOWN_CONVERSIONS = Object.freeze({
|
|
|
1625
1632
|
// (100 * 185806080000) / 8896443230521 = 2.088543423315013 - https://www.wolframalpha.com/input?i=Pa+unit
|
|
1626
1633
|
"lbf/100ft2|Pa": (val) => val * 0.4788025898033584,
|
|
1627
1634
|
// 8896443230521 / (185806080000 * 100) = 0.47880258980335844, // https://www.wolframalpha.com/input?i=Pa+unit
|
|
1635
|
+
// sensor accelerometer
|
|
1636
|
+
"g|m/s2": (val) => val * 9.81,
|
|
1637
|
+
"m/s2|g": (val) => val / 9.81,
|
|
1638
|
+
// sensor magnetometer
|
|
1639
|
+
"Gs|nT": (val) => val * 1e5,
|
|
1640
|
+
"nT/Gs": (val) => val / 1e5,
|
|
1628
1641
|
// GIS Location Systems
|
|
1629
1642
|
"usft|m": (val) => val * 0.30480060960121924,
|
|
1630
1643
|
"lk|m": (val) => val * 0.201168,
|
|
@@ -1748,6 +1761,12 @@ const INTERMEDIATE_CONVERSIONS = Object.freeze({
|
|
|
1748
1761
|
"m/min": "m/s",
|
|
1749
1762
|
"m/h": "m/s",
|
|
1750
1763
|
mph: "m/s",
|
|
1764
|
+
// sensorAccelerometer
|
|
1765
|
+
"g": "m/s2",
|
|
1766
|
+
"m/s2": "g",
|
|
1767
|
+
// sensorMagnetometer
|
|
1768
|
+
"Gs": "nT",
|
|
1769
|
+
"nT": "Gs",
|
|
1751
1770
|
// FLOW RATE
|
|
1752
1771
|
"ft3/s": "m3/s",
|
|
1753
1772
|
lpm: "m3/s",
|
|
@@ -1919,7 +1938,9 @@ const QUANTITIES_DESCRIPTION = {
|
|
|
1919
1938
|
wgrad: "Weight Gradient, change in weight per unit length",
|
|
1920
1939
|
entalphy: "Entalphy, total heat content of a system",
|
|
1921
1940
|
pressurechange: "Change in pressure over time or between two points",
|
|
1922
|
-
rpm: "Rotations per minute, a measure of the frequency of rotation, specifying the number of full rotations completed in one minute around a fixed axis"
|
|
1941
|
+
rpm: "Rotations per minute, a measure of the frequency of rotation, specifying the number of full rotations completed in one minute around a fixed axis",
|
|
1942
|
+
sensorAccelerometer: "Measures the strength of gravitational acceleration at a location. Common units include:\nm/s\xB2 - Standard SI unit for gravitational acceleration\ng-units - Relative to Earth's gravity (1g = 9.8065m/s\xB2)\nGal - Used in geophysics and precision measurements (1 Gal = 0.01 m/s\xB2)",
|
|
1943
|
+
sensorMagnetometer: "Measures the strength of magnetic forces at a position. Common units include:\nTesla (T) - Standard SI unit for magnetic field strength\nGauss (G) - Smaller unit often used for everyday measurements (1 T = 10,000 G)\nNanotesla (nT) - Useful for moderate field strengths\n"
|
|
1923
1944
|
};
|
|
1924
1945
|
const UNITS_DESCRIPTION = {
|
|
1925
1946
|
in: "Inches",
|
|
@@ -855,6 +855,9 @@ const LABELS = Object.freeze({
|
|
|
855
855
|
mph: "mph",
|
|
856
856
|
"km/h": "km/h",
|
|
857
857
|
"m/s2": "m/s\xB2",
|
|
858
|
+
"Gs": "Gs",
|
|
859
|
+
"nT": "nT",
|
|
860
|
+
"g": "g",
|
|
858
861
|
"ft/s2": "ft/s\xB2",
|
|
859
862
|
"Pa*s": "Pa\u22C5s",
|
|
860
863
|
P: "P",
|
|
@@ -1060,6 +1063,8 @@ const ALT_UNITS = Object.freeze({
|
|
|
1060
1063
|
wearFactor: ["E-09/bar", "E-10/psi", "E-14/pa"],
|
|
1061
1064
|
volumeGradient: ["m3/m", "cm3/m", "mm3/m", "ft3/ft", "in3/ft"],
|
|
1062
1065
|
shearStress: ["Pa", "lbf/100ft2"],
|
|
1066
|
+
sensorAccelerometer: ["g", "m/s2"],
|
|
1067
|
+
sensorMagnetometer: ["Gs", "nT"],
|
|
1063
1068
|
location: ["lk", "ftCla", "lkCla", "ftSe", "ydSe", "chSe", "chSe(T)", "ftGC", "ydInd", "ft", "m", "usft"],
|
|
1064
1069
|
mixingRequirements: ["m3/t", "L/100kg"],
|
|
1065
1070
|
entalphy: ["J/kg", "kJ/kg", "BTU/lbm"]
|
|
@@ -1117,7 +1122,9 @@ const UNIT_FROM_KEY = Object.freeze({
|
|
|
1117
1122
|
mixingRequirements: "m3/t",
|
|
1118
1123
|
entalphy: "J/kg",
|
|
1119
1124
|
shearStress: "Pa",
|
|
1120
|
-
volumeGradient: "m3/m"
|
|
1125
|
+
volumeGradient: "m3/m",
|
|
1126
|
+
sensorAccelerometer: "g",
|
|
1127
|
+
sensorMagnetometer: "Gs"
|
|
1121
1128
|
});
|
|
1122
1129
|
const C = Object.freeze({
|
|
1123
1130
|
g: 0.0980665175317196,
|
|
@@ -1623,6 +1630,12 @@ const KNOWN_CONVERSIONS = Object.freeze({
|
|
|
1623
1630
|
// (100 * 185806080000) / 8896443230521 = 2.088543423315013 - https://www.wolframalpha.com/input?i=Pa+unit
|
|
1624
1631
|
"lbf/100ft2|Pa": (val) => val * 0.4788025898033584,
|
|
1625
1632
|
// 8896443230521 / (185806080000 * 100) = 0.47880258980335844, // https://www.wolframalpha.com/input?i=Pa+unit
|
|
1633
|
+
// sensor accelerometer
|
|
1634
|
+
"g|m/s2": (val) => val * 9.81,
|
|
1635
|
+
"m/s2|g": (val) => val / 9.81,
|
|
1636
|
+
// sensor magnetometer
|
|
1637
|
+
"Gs|nT": (val) => val * 1e5,
|
|
1638
|
+
"nT/Gs": (val) => val / 1e5,
|
|
1626
1639
|
// GIS Location Systems
|
|
1627
1640
|
"usft|m": (val) => val * 0.30480060960121924,
|
|
1628
1641
|
"lk|m": (val) => val * 0.201168,
|
|
@@ -1746,6 +1759,12 @@ const INTERMEDIATE_CONVERSIONS = Object.freeze({
|
|
|
1746
1759
|
"m/min": "m/s",
|
|
1747
1760
|
"m/h": "m/s",
|
|
1748
1761
|
mph: "m/s",
|
|
1762
|
+
// sensorAccelerometer
|
|
1763
|
+
"g": "m/s2",
|
|
1764
|
+
"m/s2": "g",
|
|
1765
|
+
// sensorMagnetometer
|
|
1766
|
+
"Gs": "nT",
|
|
1767
|
+
"nT": "Gs",
|
|
1749
1768
|
// FLOW RATE
|
|
1750
1769
|
"ft3/s": "m3/s",
|
|
1751
1770
|
lpm: "m3/s",
|
|
@@ -1917,7 +1936,9 @@ const QUANTITIES_DESCRIPTION = {
|
|
|
1917
1936
|
wgrad: "Weight Gradient, change in weight per unit length",
|
|
1918
1937
|
entalphy: "Entalphy, total heat content of a system",
|
|
1919
1938
|
pressurechange: "Change in pressure over time or between two points",
|
|
1920
|
-
rpm: "Rotations per minute, a measure of the frequency of rotation, specifying the number of full rotations completed in one minute around a fixed axis"
|
|
1939
|
+
rpm: "Rotations per minute, a measure of the frequency of rotation, specifying the number of full rotations completed in one minute around a fixed axis",
|
|
1940
|
+
sensorAccelerometer: "Measures the strength of gravitational acceleration at a location. Common units include:\nm/s\xB2 - Standard SI unit for gravitational acceleration\ng-units - Relative to Earth's gravity (1g = 9.8065m/s\xB2)\nGal - Used in geophysics and precision measurements (1 Gal = 0.01 m/s\xB2)",
|
|
1941
|
+
sensorMagnetometer: "Measures the strength of magnetic forces at a position. Common units include:\nTesla (T) - Standard SI unit for magnetic field strength\nGauss (G) - Smaller unit often used for everyday measurements (1 T = 10,000 G)\nNanotesla (nT) - Useful for moderate field strengths\n"
|
|
1921
1942
|
};
|
|
1922
1943
|
const UNITS_DESCRIPTION = {
|
|
1923
1944
|
in: "Inches",
|
package/dist/units.cjs
CHANGED
package/dist/units.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ae as EXP_NOTATION_RE, ad as SEPARATOR, i as altUnitsList, c as checkAndCleanDecimalComma, q as convertAndGetValue, x as convertAndGetValueStrict, p as convertSamePrecision, j as convertTable, g as getAltUnitsListByQuantity, b as getQuantities, o as getUnit, a as getUnitsForQuantity, n as getValue, m as isValueWithUnit, l as label, r as roundNumberWithLabel, s as showAltUnitsList, e as split, t as to, h as toBase, u as unitFromKey, d as unitFromQuantity, f as unum, k as unumWithUnit, v as validateAndClean, z as validateNumber, y as withPrettyUnitLabel, w as withUnit } from './units-
|
|
1
|
+
export { ae as EXP_NOTATION_RE, ad as SEPARATOR, i as altUnitsList, c as checkAndCleanDecimalComma, q as convertAndGetValue, x as convertAndGetValueStrict, p as convertSamePrecision, j as convertTable, g as getAltUnitsListByQuantity, b as getQuantities, o as getUnit, a as getUnitsForQuantity, n as getValue, m as isValueWithUnit, l as label, r as roundNumberWithLabel, s as showAltUnitsList, e as split, t as to, h as toBase, u as unitFromKey, d as unitFromQuantity, f as unum, k as unumWithUnit, v as validateAndClean, z as validateNumber, y as withPrettyUnitLabel, w as withUnit } from './units-BvWnXAYk.js';
|
|
2
2
|
import 'fraction.js';
|