@punks/backend-entity-manager 0.0.424 → 0.0.426
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 +6 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -279,12 +279,14 @@ class EntitySerializer {
|
|
|
279
279
|
keysTransform: backendCore.ExcelKeyTransform.Lower,
|
|
280
280
|
dateColumns: dateColumns.map((x) => x.name),
|
|
281
281
|
});
|
|
282
|
-
console.log("records", records);
|
|
283
282
|
return Array.isArray(records)
|
|
284
283
|
? records.map((x, i) => this.convertSheetRecord(x, definition, i))
|
|
285
284
|
: Object.values(records).flatMap((x, i) => this.convertSheetRecord(x, definition, i));
|
|
286
285
|
}
|
|
287
286
|
convertSheetRecord(record, definition, rowIndex) {
|
|
287
|
+
console.log("record", record);
|
|
288
|
+
console.log("definition", definition);
|
|
289
|
+
console.log("rowIndex", rowIndex);
|
|
288
290
|
if (definition.sheet?.useTypeColumn &&
|
|
289
291
|
(!record._type || record._type !== this.entityName)) {
|
|
290
292
|
throw new Error(`Invalid record type ${record._type} -> record: \n${JSON.stringify(record)}`);
|
|
@@ -41018,7 +41020,9 @@ const fieldRequiredValidator = (item, selector) => {
|
|
|
41018
41020
|
};
|
|
41019
41021
|
const fieldTextValidator = (item, selector, params) => {
|
|
41020
41022
|
const value = selector(item);
|
|
41021
|
-
const values = Array.isArray(value)
|
|
41023
|
+
const values = Array.isArray(value)
|
|
41024
|
+
? value.filter(Boolean)
|
|
41025
|
+
: [value].filter(Boolean);
|
|
41022
41026
|
const isRequiredValid = params.required
|
|
41023
41027
|
? values.length > 0 &&
|
|
41024
41028
|
values.every((v) => typeof v === "string" && v.length > 0)
|