av6-core 1.6.4 → 1.6.5
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.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1590,7 +1590,6 @@ var buildJoiSchemaForOp = (cfg, op, ctx) => {
|
|
|
1590
1590
|
|
|
1591
1591
|
// src/utils/dynamicOperation.utils.ts
|
|
1592
1592
|
var import_av6_utils = require("av6-utils");
|
|
1593
|
-
var import_decimal = __toESM(require("decimal.js"));
|
|
1594
1593
|
var OP_PRECEDENCE = {
|
|
1595
1594
|
"u-": 3,
|
|
1596
1595
|
// unary minus
|
|
@@ -1796,9 +1795,12 @@ function getDynamicValueOrExpression(obj, accessorOrExpr) {
|
|
|
1796
1795
|
}
|
|
1797
1796
|
return getDynamicValue(obj, s);
|
|
1798
1797
|
}
|
|
1798
|
+
function isDecimalLike(v) {
|
|
1799
|
+
return v !== null && typeof v === "object" && typeof v.toNumber === "function" && typeof v.toString === "function";
|
|
1800
|
+
}
|
|
1799
1801
|
function toNumberDeep(val) {
|
|
1800
1802
|
if (val === null || val === void 0) return val;
|
|
1801
|
-
if (val
|
|
1803
|
+
if (isDecimalLike(val)) return val.toNumber();
|
|
1802
1804
|
if (val instanceof Date) return val;
|
|
1803
1805
|
if (Array.isArray(val)) return val.map(toNumberDeep);
|
|
1804
1806
|
if (typeof val === "object") {
|
package/dist/index.mjs
CHANGED
|
@@ -1540,7 +1540,6 @@ var buildJoiSchemaForOp = (cfg, op, ctx) => {
|
|
|
1540
1540
|
|
|
1541
1541
|
// src/utils/dynamicOperation.utils.ts
|
|
1542
1542
|
import { applyRound } from "av6-utils";
|
|
1543
|
-
import Decimal from "decimal.js";
|
|
1544
1543
|
var OP_PRECEDENCE = {
|
|
1545
1544
|
"u-": 3,
|
|
1546
1545
|
// unary minus
|
|
@@ -1746,9 +1745,12 @@ function getDynamicValueOrExpression(obj, accessorOrExpr) {
|
|
|
1746
1745
|
}
|
|
1747
1746
|
return getDynamicValue(obj, s);
|
|
1748
1747
|
}
|
|
1748
|
+
function isDecimalLike(v) {
|
|
1749
|
+
return v !== null && typeof v === "object" && typeof v.toNumber === "function" && typeof v.toString === "function";
|
|
1750
|
+
}
|
|
1749
1751
|
function toNumberDeep(val) {
|
|
1750
1752
|
if (val === null || val === void 0) return val;
|
|
1751
|
-
if (val
|
|
1753
|
+
if (isDecimalLike(val)) return val.toNumber();
|
|
1752
1754
|
if (val instanceof Date) return val;
|
|
1753
1755
|
if (Array.isArray(val)) return val.map(toNumberDeep);
|
|
1754
1756
|
if (typeof val === "object") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "av6-core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"av6-utils": "^1.0.4",
|
|
27
27
|
"axios": "^1.11.0",
|
|
28
|
-
"decimal.js": "^10.6.0",
|
|
29
28
|
"exceljs": "^4.4.0",
|
|
30
29
|
"handlebars": "^4.7.8",
|
|
31
30
|
"joi": "^17.13.3",
|