tools-min-ns 1.9.9 → 1.9.10
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/README.md
CHANGED
|
@@ -65,7 +65,7 @@ declare namespace Me {
|
|
|
65
65
|
function invertedColors(): boolean | undefined;
|
|
66
66
|
function forcedColors(): boolean | undefined;
|
|
67
67
|
function monochrome(): number | undefined;
|
|
68
|
-
function contrast(): 0 |
|
|
68
|
+
function contrast(): 0 | 10 | 1 | -1 | undefined;
|
|
69
69
|
function reducedMotion(): boolean | undefined;
|
|
70
70
|
function reducedTransparency(): boolean | undefined;
|
|
71
71
|
function hdr(): boolean | undefined;
|
package/esm/number/NumberUtil.js
CHANGED
|
@@ -137,12 +137,9 @@ var NumberUtil;
|
|
|
137
137
|
if (n === void 0) {
|
|
138
138
|
n = 2;
|
|
139
139
|
}
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
var lastChar = val[val.length - 1] === '.' ? '.' : '';
|
|
144
|
-
var str = (isNaN(parseFloat(val)) ? '' : parseInt("".concat(Math.round(parseFloat(val) * Math.pow(10, n)))) / Math.pow(10, n)) + lastChar;
|
|
145
|
-
return Number(str);
|
|
140
|
+
if (!NumberUtil.isaFinite(Number(val))) return 0;
|
|
141
|
+
var num = parseInt("".concat(Math.round(parseFloat(val) * Math.pow(10, n)))) / Math.pow(10, n);
|
|
142
|
+
return NumberUtil.isaFinite(num) ? num : 0;
|
|
146
143
|
}
|
|
147
144
|
NumberUtil.correctNumberInput = correctNumberInput;
|
|
148
145
|
/**
|
|
@@ -65,7 +65,7 @@ declare namespace Me {
|
|
|
65
65
|
function invertedColors(): boolean | undefined;
|
|
66
66
|
function forcedColors(): boolean | undefined;
|
|
67
67
|
function monochrome(): number | undefined;
|
|
68
|
-
function contrast(): 0 |
|
|
68
|
+
function contrast(): 0 | 10 | 1 | -1 | undefined;
|
|
69
69
|
function reducedMotion(): boolean | undefined;
|
|
70
70
|
function reducedTransparency(): boolean | undefined;
|
|
71
71
|
function hdr(): boolean | undefined;
|
package/lib/number/NumberUtil.js
CHANGED
|
@@ -147,12 +147,9 @@ var NumberUtil;
|
|
|
147
147
|
if (n === void 0) {
|
|
148
148
|
n = 2;
|
|
149
149
|
}
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
var lastChar = val[val.length - 1] === '.' ? '.' : '';
|
|
154
|
-
var str = (isNaN(parseFloat(val)) ? '' : parseInt("".concat(Math.round(parseFloat(val) * Math.pow(10, n)))) / Math.pow(10, n)) + lastChar;
|
|
155
|
-
return Number(str);
|
|
150
|
+
if (!NumberUtil.isaFinite(Number(val))) return 0;
|
|
151
|
+
var num = parseInt("".concat(Math.round(parseFloat(val) * Math.pow(10, n)))) / Math.pow(10, n);
|
|
152
|
+
return NumberUtil.isaFinite(num) ? num : 0;
|
|
156
153
|
}
|
|
157
154
|
NumberUtil.correctNumberInput = correctNumberInput;
|
|
158
155
|
/**
|