av6-core 1.6.3 → 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 +18 -0
- package/dist/index.mjs +18 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1795,6 +1795,23 @@ function getDynamicValueOrExpression(obj, accessorOrExpr) {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
return getDynamicValue(obj, s);
|
|
1797
1797
|
}
|
|
1798
|
+
function isDecimalLike(v) {
|
|
1799
|
+
return v !== null && typeof v === "object" && typeof v.toNumber === "function" && typeof v.toString === "function";
|
|
1800
|
+
}
|
|
1801
|
+
function toNumberDeep(val) {
|
|
1802
|
+
if (val === null || val === void 0) return val;
|
|
1803
|
+
if (isDecimalLike(val)) return val.toNumber();
|
|
1804
|
+
if (val instanceof Date) return val;
|
|
1805
|
+
if (Array.isArray(val)) return val.map(toNumberDeep);
|
|
1806
|
+
if (typeof val === "object") {
|
|
1807
|
+
const out = {};
|
|
1808
|
+
for (const [k, v] of Object.entries(val)) {
|
|
1809
|
+
out[k] = toNumberDeep(v);
|
|
1810
|
+
}
|
|
1811
|
+
return out;
|
|
1812
|
+
}
|
|
1813
|
+
return val;
|
|
1814
|
+
}
|
|
1798
1815
|
|
|
1799
1816
|
// src/services/common.service.ts
|
|
1800
1817
|
var import_axios = __toESM(require("axios"));
|
|
@@ -1839,6 +1856,7 @@ var commonService = (serviceDeps) => {
|
|
|
1839
1856
|
async commonExcelService(searchParams) {
|
|
1840
1857
|
logger.info("entering::commonExcelService::service");
|
|
1841
1858
|
const commonData = await commonRepositoryFactory.fixedSearchWoPagination(searchParams);
|
|
1859
|
+
commonData.data = toNumberDeep(commonData.data);
|
|
1842
1860
|
const wb = new import_exceljs.default.Workbook();
|
|
1843
1861
|
const ws = wb.addWorksheet(`${searchParams.sheetName}`);
|
|
1844
1862
|
ws.properties.defaultRowHeight = 18;
|
package/dist/index.mjs
CHANGED
|
@@ -1745,6 +1745,23 @@ function getDynamicValueOrExpression(obj, accessorOrExpr) {
|
|
|
1745
1745
|
}
|
|
1746
1746
|
return getDynamicValue(obj, s);
|
|
1747
1747
|
}
|
|
1748
|
+
function isDecimalLike(v) {
|
|
1749
|
+
return v !== null && typeof v === "object" && typeof v.toNumber === "function" && typeof v.toString === "function";
|
|
1750
|
+
}
|
|
1751
|
+
function toNumberDeep(val) {
|
|
1752
|
+
if (val === null || val === void 0) return val;
|
|
1753
|
+
if (isDecimalLike(val)) return val.toNumber();
|
|
1754
|
+
if (val instanceof Date) return val;
|
|
1755
|
+
if (Array.isArray(val)) return val.map(toNumberDeep);
|
|
1756
|
+
if (typeof val === "object") {
|
|
1757
|
+
const out = {};
|
|
1758
|
+
for (const [k, v] of Object.entries(val)) {
|
|
1759
|
+
out[k] = toNumberDeep(v);
|
|
1760
|
+
}
|
|
1761
|
+
return out;
|
|
1762
|
+
}
|
|
1763
|
+
return val;
|
|
1764
|
+
}
|
|
1748
1765
|
|
|
1749
1766
|
// src/services/common.service.ts
|
|
1750
1767
|
import axios from "axios";
|
|
@@ -1789,6 +1806,7 @@ var commonService = (serviceDeps) => {
|
|
|
1789
1806
|
async commonExcelService(searchParams) {
|
|
1790
1807
|
logger.info("entering::commonExcelService::service");
|
|
1791
1808
|
const commonData = await commonRepositoryFactory.fixedSearchWoPagination(searchParams);
|
|
1809
|
+
commonData.data = toNumberDeep(commonData.data);
|
|
1792
1810
|
const wb = new ExcelJs.Workbook();
|
|
1793
1811
|
const ws = wb.addWorksheet(`${searchParams.sheetName}`);
|
|
1794
1812
|
ws.properties.defaultRowHeight = 18;
|