@punks/backend-core 0.0.74 → 0.0.75
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/cjs/index.js +11 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/utils/xls.d.ts +1 -1
- package/dist/esm/index.js +11 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/utils/xls.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -30999,12 +30999,17 @@ const aggregateRow = (header, row, options) => {
|
|
|
30999
30999
|
return record;
|
|
31000
31000
|
};
|
|
31001
31001
|
const excelParse = (file, options) => {
|
|
31002
|
-
const sheets = parseExcelRaw(file);
|
|
31003
|
-
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31002
|
+
const sheets = parseExcelRaw(file).map((x) => parseSheet(x, options));
|
|
31003
|
+
return sheets.length === 1
|
|
31004
|
+
? sheets[0]
|
|
31005
|
+
: sheets.reduce((acc, sheet, index) => {
|
|
31006
|
+
acc[sheet.name || `Sheet${index + 1}`] = sheets[index];
|
|
31007
|
+
return acc;
|
|
31008
|
+
}, {});
|
|
31009
|
+
};
|
|
31010
|
+
const parseSheet = (sheet, options) => {
|
|
31011
|
+
const [header, ...lines] = sheet.data.filter((x) => isValidRow(x));
|
|
31012
|
+
return lines.map((x) => aggregateRow(header, x, options));
|
|
31008
31013
|
};
|
|
31009
31014
|
|
|
31010
31015
|
const getLevelValue = (level) => {
|