@punks/backend-entity-manager 0.0.435 → 0.0.437
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 +5 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/serializer.d.ts +1 -0
- package/dist/esm/index.js +5 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/serializer.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -289,11 +289,13 @@ class EntitySerializer {
|
|
|
289
289
|
}
|
|
290
290
|
const entity = (definition.autoColumns ? { ...record } : {});
|
|
291
291
|
for (const column of definition.columns) {
|
|
292
|
-
const columnName =
|
|
293
|
-
|
|
292
|
+
const columnName = [column.name, ...(column?.aliases ?? [])].find((x) => x in record) ?? "";
|
|
293
|
+
console.log("name", columnName);
|
|
294
|
+
console.log("record", entity);
|
|
295
|
+
if (!columnName)
|
|
294
296
|
continue;
|
|
295
297
|
if (column.parseAction) {
|
|
296
|
-
column.parseAction(record[columnName], entity);
|
|
298
|
+
column.parseAction(record[normalizeSheetColumn(columnName)], entity);
|
|
297
299
|
continue;
|
|
298
300
|
}
|
|
299
301
|
if (typeof column.selector === "function") {
|