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