@punks/backend-entity-manager 0.0.427 → 0.0.428

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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import { ExcelParseOptions } from "@punks/backend-core";
2
3
  export type EntryValidationError = {
3
4
  errorCode: string;
4
5
  value?: any;
@@ -52,6 +53,7 @@ export type EntitySerializerSheetOptions = {
52
53
  export type EntitySerializerSheetDefinition<TSheetItem> = {
53
54
  columns: EntitySerializerColumnDefinition<TSheetItem>[];
54
55
  sheet?: EntitySerializerSheetOptions;
56
+ options?: ExcelParseOptions;
55
57
  };
56
58
  export type EntityExportFile = {
57
59
  content: Buffer;
package/dist/esm/index.js CHANGED
@@ -263,12 +263,9 @@ class EntitySerializer {
263
263
  const records = excelParse(data, {
264
264
  keysTransform: ExcelKeyTransform.Lower,
265
265
  dateColumns: dateColumns.map((x) => x.name),
266
+ ...(definition?.options ? definition.options : {}),
266
267
  });
267
- return Array.isArray(records)
268
- ? records.map((x, i) => this.convertSheetRecord(x, definition, i))
269
- : Object.values(records)
270
- .flat()
271
- .map((x, i) => this.convertSheetRecord(x, definition, i));
268
+ return records.map((x, i) => this.convertSheetRecord(x, definition, i));
272
269
  }
273
270
  convertSheetRecord(record, definition, rowIndex) {
274
271
  console.log("record", record);