@oliasoft-open-source/units 1.2.0 → 1.2.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/constants.d.ts +718 -0
- package/dist/constants.js +798 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +4 -0
- package/dist/interfaces.js +3 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/units.d.ts +25 -0
- package/dist/units.js +320 -0
- package/dist/units.js.map +1 -0
- package/dist/utils.d.ts +18 -0
- package/dist/utils.js +269 -0
- package/dist/utils.js.map +1 -0
- package/package.json +1 -1
package/dist/utils.js
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.get_conf_int_from_k = exports.get_k_from_conf_int = exports.erf = exports.newton = exports.isNonNumerical = exports.toNum = exports.cleanNum = exports.cleanNumStr = exports.numFraction = exports.asFraction = exports.fraction = exports.roundNumber = exports.getNumberOfDigitsToShow = exports.charCount = exports.formatNumber = exports.allNumbers = exports.isNumeric = exports.isEmptyValueWithUnit = void 0;
|
|
7
|
+
const fraction_js_1 = __importDefault(require("fraction.js"));
|
|
8
|
+
const isNull = (str) => str === null;
|
|
9
|
+
const isUndefined = (str) => str === undefined;
|
|
10
|
+
const isArray = (str) => str && str.constructor === Array;
|
|
11
|
+
const isObject = (str) => str && str.constructor === Object;
|
|
12
|
+
const hasDivisor = (str) => str && typeof str.includes === 'function' && str.includes('/');
|
|
13
|
+
const isEmptyString = (str) => str === '';
|
|
14
|
+
const isTrailingPeriodSeparator = (str) => str && str[str.length - 1] === '.';
|
|
15
|
+
const isTrailingCommaSeparator = (str) => str && str[str.length - 1] === ',';
|
|
16
|
+
function isEmptyValueWithUnit(val) {
|
|
17
|
+
return typeof val === 'string' && val.length > 0 && val.startsWith('|');
|
|
18
|
+
}
|
|
19
|
+
exports.isEmptyValueWithUnit = isEmptyValueWithUnit;
|
|
20
|
+
function isNumeric(v) {
|
|
21
|
+
return typeof v === 'string' ? !isNaN(parseFloat(v)) && isFinite(v) : isFinite(v);
|
|
22
|
+
}
|
|
23
|
+
exports.isNumeric = isNumeric;
|
|
24
|
+
function allNumbers(arr) {
|
|
25
|
+
return (!arr.some(val => typeof val !== 'number'));
|
|
26
|
+
}
|
|
27
|
+
exports.allNumbers = allNumbers;
|
|
28
|
+
function formatNumber(number) {
|
|
29
|
+
const parts = number.toString().split('.');
|
|
30
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
31
|
+
return parts.join('.');
|
|
32
|
+
}
|
|
33
|
+
exports.formatNumber = formatNumber;
|
|
34
|
+
function charCount(chr, str) {
|
|
35
|
+
const single_char = (chr + '')[0];
|
|
36
|
+
let total = 0;
|
|
37
|
+
let last_location = str.indexOf(single_char, 0) + 1;
|
|
38
|
+
while (last_location > 0) {
|
|
39
|
+
last_location = str.indexOf(single_char, last_location) + 1;
|
|
40
|
+
total += 1;
|
|
41
|
+
}
|
|
42
|
+
return total;
|
|
43
|
+
}
|
|
44
|
+
exports.charCount = charCount;
|
|
45
|
+
function getNumberOfDigitsToShow(num, maxNumDigits = 20) {
|
|
46
|
+
const defaultDigits = Math.min(4, maxNumDigits);
|
|
47
|
+
let digits = defaultDigits;
|
|
48
|
+
if (typeof num !== 'number') {
|
|
49
|
+
return defaultDigits;
|
|
50
|
+
}
|
|
51
|
+
const numStr = num.toString();
|
|
52
|
+
const RegExForExponentialNumber = /-?[0-9.,]*[Ee]-?[0-9]+/;
|
|
53
|
+
if (RegExForExponentialNumber.test(numStr)) {
|
|
54
|
+
while (Math.abs(num) * (10 ** digits) < 1 && digits < maxNumDigits) {
|
|
55
|
+
digits++;
|
|
56
|
+
}
|
|
57
|
+
return Math.min(digits + (defaultDigits - 1), maxNumDigits);
|
|
58
|
+
}
|
|
59
|
+
if (num > 1 || num < -1) {
|
|
60
|
+
return defaultDigits;
|
|
61
|
+
}
|
|
62
|
+
for (let i = 2; i < numStr.length; i++) {
|
|
63
|
+
const element = numStr[i];
|
|
64
|
+
if (element !== '0') {
|
|
65
|
+
return Math.min(maxNumDigits, digits + i - 2);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return digits;
|
|
69
|
+
}
|
|
70
|
+
exports.getNumberOfDigitsToShow = getNumberOfDigitsToShow;
|
|
71
|
+
function roundNumber(num, round = 4) {
|
|
72
|
+
const orgNum = num;
|
|
73
|
+
if (num == null || round < 0) {
|
|
74
|
+
return '';
|
|
75
|
+
}
|
|
76
|
+
if (typeof num === 'string') {
|
|
77
|
+
num = parseFloat(num);
|
|
78
|
+
if (isNaN(num)) {
|
|
79
|
+
return orgNum;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return parseFloat(num.toFixed(round).toString());
|
|
83
|
+
}
|
|
84
|
+
exports.roundNumber = roundNumber;
|
|
85
|
+
function fraction(str) {
|
|
86
|
+
if (str instanceof Array || str === null || str === undefined) {
|
|
87
|
+
return NaN;
|
|
88
|
+
}
|
|
89
|
+
if (typeof str === 'string') {
|
|
90
|
+
str = str.trim();
|
|
91
|
+
}
|
|
92
|
+
if (str === '') {
|
|
93
|
+
return NaN;
|
|
94
|
+
}
|
|
95
|
+
let result = NaN;
|
|
96
|
+
let infinite = false;
|
|
97
|
+
try {
|
|
98
|
+
const fractionObject = new fraction_js_1.default(str);
|
|
99
|
+
if (fractionObject !== undefined) {
|
|
100
|
+
result = fractionObject.valueOf();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
if (e.name === 'DivisionByZero') {
|
|
105
|
+
infinite = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return infinite ? Infinity : result;
|
|
109
|
+
}
|
|
110
|
+
exports.fraction = fraction;
|
|
111
|
+
function asFraction(str) {
|
|
112
|
+
if (typeof str === 'string') {
|
|
113
|
+
str = str.trim();
|
|
114
|
+
}
|
|
115
|
+
if (str === '') {
|
|
116
|
+
str = '0';
|
|
117
|
+
}
|
|
118
|
+
return new fraction_js_1.default(str).toFraction(true);
|
|
119
|
+
}
|
|
120
|
+
exports.asFraction = asFraction;
|
|
121
|
+
function numFraction(str) {
|
|
122
|
+
if (str instanceof Array || str === null || str === undefined || str === '') {
|
|
123
|
+
return str;
|
|
124
|
+
}
|
|
125
|
+
if (typeof str === 'string') {
|
|
126
|
+
str = str.trim();
|
|
127
|
+
}
|
|
128
|
+
let result = str;
|
|
129
|
+
try {
|
|
130
|
+
const fractionObject = new fraction_js_1.default(str);
|
|
131
|
+
if (fractionObject !== undefined) {
|
|
132
|
+
result = fractionObject.valueOf();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
console.warn('Error in numFraction() method: ', str);
|
|
137
|
+
}
|
|
138
|
+
return result.valueOf();
|
|
139
|
+
}
|
|
140
|
+
exports.numFraction = numFraction;
|
|
141
|
+
function cleanNumStr(str) {
|
|
142
|
+
let cleanString = str + '';
|
|
143
|
+
const slashCount = charCount('/', cleanString);
|
|
144
|
+
const spaceCount = charCount(' ', cleanString) + charCount(' ', cleanString);
|
|
145
|
+
let dotcount = charCount('.', cleanString);
|
|
146
|
+
let commacount = charCount(',', cleanString);
|
|
147
|
+
if (slashCount === 0 && spaceCount > 0) {
|
|
148
|
+
cleanString = cleanString.replace(/\s/g, '');
|
|
149
|
+
}
|
|
150
|
+
if (commacount > 1) {
|
|
151
|
+
cleanString = cleanString.replace(/,/g, '');
|
|
152
|
+
}
|
|
153
|
+
if (dotcount > 1) {
|
|
154
|
+
cleanString = cleanString.replace(/\./g, '');
|
|
155
|
+
}
|
|
156
|
+
commacount = charCount(',', cleanString);
|
|
157
|
+
dotcount = charCount('.', cleanString);
|
|
158
|
+
if ((dotcount === 1) && (commacount === 1)) {
|
|
159
|
+
if (cleanString.indexOf(',') > cleanString.indexOf('.')) {
|
|
160
|
+
cleanString = cleanString.replace('.', '');
|
|
161
|
+
cleanString = cleanString.replace(',', '.');
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
cleanString = cleanString.replace(',', '');
|
|
165
|
+
}
|
|
166
|
+
if (cleanString.indexOf('.') === 0) {
|
|
167
|
+
cleanString = 0 + cleanString;
|
|
168
|
+
}
|
|
169
|
+
return cleanString;
|
|
170
|
+
}
|
|
171
|
+
if (!dotcount && commacount) {
|
|
172
|
+
cleanString = cleanString.replace(',', '.');
|
|
173
|
+
}
|
|
174
|
+
if (cleanString.indexOf('.') === 0) {
|
|
175
|
+
cleanString = 0 + cleanString;
|
|
176
|
+
}
|
|
177
|
+
return cleanString;
|
|
178
|
+
}
|
|
179
|
+
exports.cleanNumStr = cleanNumStr;
|
|
180
|
+
function cleanNum(str) {
|
|
181
|
+
if (typeof str === 'number') {
|
|
182
|
+
return str;
|
|
183
|
+
}
|
|
184
|
+
return parseFloat(cleanNumStr(str));
|
|
185
|
+
}
|
|
186
|
+
exports.cleanNum = cleanNum;
|
|
187
|
+
function toNum(input, defaultValue, minimum) {
|
|
188
|
+
let result;
|
|
189
|
+
defaultValue = (defaultValue === undefined) ? input : defaultValue;
|
|
190
|
+
if (isNull(input)
|
|
191
|
+
|| isUndefined(input)
|
|
192
|
+
|| isEmptyString(input)
|
|
193
|
+
|| isTrailingPeriodSeparator(input)
|
|
194
|
+
|| isTrailingCommaSeparator(input)
|
|
195
|
+
|| isArray(input)
|
|
196
|
+
|| isObject(input)) {
|
|
197
|
+
result = defaultValue;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
let number;
|
|
201
|
+
const cleaned = cleanNumStr(input);
|
|
202
|
+
if (hasDivisor(cleaned)) {
|
|
203
|
+
number = numFraction(cleaned);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
number = parseFloat(cleaned);
|
|
207
|
+
}
|
|
208
|
+
if (isNaN(number)) {
|
|
209
|
+
result = defaultValue;
|
|
210
|
+
}
|
|
211
|
+
else if (minimum && number < minimum) {
|
|
212
|
+
result = minimum;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
result = number;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
exports.toNum = toNum;
|
|
221
|
+
const isNonNumerical = (value) => {
|
|
222
|
+
const isStringNaN = value === 'NaN';
|
|
223
|
+
const isNumberButNaN = typeof value === 'number' && isNaN(value);
|
|
224
|
+
const isStringNotNumericFractionDependent = typeof value === 'string'
|
|
225
|
+
&& !isNumeric(value)
|
|
226
|
+
&& isNaN(numFraction(value));
|
|
227
|
+
return isStringNaN || isNumberButNaN || isStringNotNumericFractionDependent;
|
|
228
|
+
};
|
|
229
|
+
exports.isNonNumerical = isNonNumerical;
|
|
230
|
+
const { abs, exp, sqrt } = Math;
|
|
231
|
+
function newton(f, df, x0, tol = 1e-8, max_iter = 30) {
|
|
232
|
+
let X = x0;
|
|
233
|
+
let iter = 0;
|
|
234
|
+
let err = 1;
|
|
235
|
+
while (err > tol && iter < max_iter) {
|
|
236
|
+
const X_new = X - f(X) / df(X);
|
|
237
|
+
err = abs(f(X_new) - f(X));
|
|
238
|
+
if (err < tol) {
|
|
239
|
+
return [X_new, true, iter];
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
X = X_new;
|
|
243
|
+
}
|
|
244
|
+
iter++;
|
|
245
|
+
}
|
|
246
|
+
return [x0, false, iter];
|
|
247
|
+
}
|
|
248
|
+
exports.newton = newton;
|
|
249
|
+
function erf(z) {
|
|
250
|
+
const t = 1 / (1 + 0.5 * abs(z));
|
|
251
|
+
const ans = 1 - t * exp(-(z ** 2) - 1.26551223
|
|
252
|
+
+ t * (1.00002368 + t * (0.37409196 + t * (0.09678418
|
|
253
|
+
+ t * (-0.18628806 + t * (0.27886807 + t * (-1.13520398
|
|
254
|
+
+ t * (1.48851587 + t * (-0.82215223 + t * (0.17087277))))))))));
|
|
255
|
+
return (z >= 0.0) ? ans : -ans;
|
|
256
|
+
}
|
|
257
|
+
exports.erf = erf;
|
|
258
|
+
function get_k_from_conf_int(a) {
|
|
259
|
+
const f = (k) => a - erf(k / sqrt(2));
|
|
260
|
+
const df = (k) => -sqrt(2 / Math.PI) * exp(-0.5 * k ** 2);
|
|
261
|
+
const [t0] = newton(f, df, 1);
|
|
262
|
+
return t0;
|
|
263
|
+
}
|
|
264
|
+
exports.get_k_from_conf_int = get_k_from_conf_int;
|
|
265
|
+
function get_conf_int_from_k(k) {
|
|
266
|
+
return erf(k / sqrt(2));
|
|
267
|
+
}
|
|
268
|
+
exports.get_conf_int_from_k = get_conf_int_from_k;
|
|
269
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAmC;AASnC,MAAM,MAAM,GAAG,CAAC,GAAQ,EAAW,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC;AACnD,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAW,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC;AAC7D,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAW,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,KAAK,KAAK,CAAC;AACxE,MAAM,QAAQ,GAAG,CAAC,GAAQ,EAAW,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,CAAC;AAC1E,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAW,EAAE,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,IAAI,GAAG,CAAC,QAAQ,CAAC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