@punks/backend-entity-manager 0.0.160 → 0.0.161

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.
@@ -5,6 +5,7 @@ export type EntitySerializerColumnDefinition<TSheetItem> = {
5
5
  colSpan?: number;
6
6
  sampleValue?: any;
7
7
  parser?: (value: any) => any;
8
+ parseAction?: (value: any, item: TSheetItem) => void;
8
9
  converter?: (value: any, item: TSheetItem) => any;
9
10
  idColumn?: boolean;
10
11
  };
package/dist/esm/index.js CHANGED
@@ -174,7 +174,12 @@ class EntitySerializer {
174
174
  }
175
175
  const entity = {};
176
176
  for (const column of definition.columns) {
177
- entity[column.selector] = this.parseColumnValue(record, column);
177
+ if (column.parseAction) {
178
+ column.parseAction(record[column.name], entity);
179
+ }
180
+ else {
181
+ entity[column.selector] = this.parseColumnValue(record, column);
182
+ }
178
183
  }
179
184
  const idField = definition.columns.find((x) => x.idColumn || x.selector === "id");
180
185
  return {