@punks/backend-core 0.0.74 → 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 CHANGED
@@ -30999,12 +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
- const lines = sheets[0].data.filter((x) => isValidRow(x));
31004
- const header = lines[0];
31005
- return lines
31006
- .slice(1)
31007
- .map((x) => aggregateRow(header, x, options));
31002
+ const sheets = parseExcelRaw(file).reduce((acc, sheet) => {
31003
+ if (options?.sheetFilter && !options.sheetFilter(sheet))
31004
+ return acc;
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();
31008
31010
  };
31009
31011
 
31010
31012
  const getLevelValue = (level) => {