@punks/backend-entity-manager 0.0.431 → 0.0.433
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 +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -274,11 +274,13 @@ class EntitySerializer {
|
|
|
274
274
|
}
|
|
275
275
|
const entity = (definition.autoColumns ? { ...record } : {});
|
|
276
276
|
for (const column of definition.columns) {
|
|
277
|
+
const columnName = normalizeSheetColumn(column.name);
|
|
278
|
+
console.log(columnName, column.name, record);
|
|
277
279
|
if (!(column.name in record))
|
|
278
280
|
continue;
|
|
279
|
-
const columnName = normalizeSheetColumn(column.name);
|
|
280
281
|
if (column.parseAction) {
|
|
281
282
|
column.parseAction(record[columnName], entity);
|
|
283
|
+
delete record[column.name];
|
|
282
284
|
continue;
|
|
283
285
|
}
|
|
284
286
|
if (typeof column.selector === "function") {
|
|
@@ -294,8 +296,6 @@ class EntitySerializer {
|
|
|
294
296
|
}
|
|
295
297
|
const validationErrors = [];
|
|
296
298
|
for (const column of definition.columns) {
|
|
297
|
-
if (!(column.name in record))
|
|
298
|
-
continue;
|
|
299
299
|
for (const validator of column.validators ?? []) {
|
|
300
300
|
const result = validator.fn(entity);
|
|
301
301
|
if (!result.isValid) {
|