@fatehan/tsrp 1.3.44 → 1.3.45
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/system.io.d.ts.map +1 -1
- package/dist/system.io.js +6 -2
- package/package.json +1 -1
package/dist/system.io.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.io.d.ts","sourceRoot":"","sources":["../src/system.io.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EAET,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,QAAA,MAAM,YAAY,GAChB,UAAU,QAAQ,EAAE,EACpB,UAAU,QAAQ,EAAE,EACpB,MAAM,IAAI,KACT,OAAO,
|
|
1
|
+
{"version":3,"file":"system.io.d.ts","sourceRoot":"","sources":["../src/system.io.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EAET,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,QAAA,MAAM,YAAY,GAChB,UAAU,QAAQ,EAAE,EACpB,UAAU,QAAQ,EAAE,EACpB,MAAM,IAAI,KACT,OAAO,EA4FT,CAAC;AA8IF,eAAe,YAAY,CAAC"}
|
package/dist/system.io.js
CHANGED
|
@@ -93,11 +93,15 @@ function Separator(value, seprator) {
|
|
|
93
93
|
function safeEvalFormula(formula, xValue) {
|
|
94
94
|
try {
|
|
95
95
|
const replaced = formula.replace(/x/g, String(xValue));
|
|
96
|
-
if (!/^[0-9+\-*/ ()
|
|
96
|
+
if (!/^[0-9+\-*/ ().><=!&|]+$/.test(replaced))
|
|
97
97
|
return null;
|
|
98
98
|
const fn = new Function(`return (${replaced});`);
|
|
99
99
|
const result = fn();
|
|
100
|
-
|
|
100
|
+
if (typeof result === "number" && !isNaN(result))
|
|
101
|
+
return result;
|
|
102
|
+
if (typeof result === "boolean")
|
|
103
|
+
return result;
|
|
104
|
+
return null;
|
|
101
105
|
}
|
|
102
106
|
catch {
|
|
103
107
|
return null;
|