@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/esm/index.js CHANGED
@@ -264,12 +264,14 @@ class EntitySerializer {
264
264
  keysTransform: ExcelKeyTransform.Lower,
265
265
  dateColumns: dateColumns.map((x) => x.name),
266
266
  });
267
- console.log("records", records);
268
267
  return Array.isArray(records)
269
268
  ? records.map((x, i) => this.convertSheetRecord(x, definition, i))
270
269
  : Object.values(records).flatMap((x, i) => this.convertSheetRecord(x, definition, i));
271
270
  }
272
271
  convertSheetRecord(record, definition, rowIndex) {
272
+ console.log("record", record);
273
+ console.log("definition", definition);
274
+ console.log("rowIndex", rowIndex);
273
275
  if (definition.sheet?.useTypeColumn &&
274
276
  (!record._type || record._type !== this.entityName)) {
275
277
  throw new Error(`Invalid record type ${record._type} -> record: \n${JSON.stringify(record)}`);
@@ -41003,7 +41005,9 @@ const fieldRequiredValidator = (item, selector) => {
41003
41005
  };
41004
41006
  const fieldTextValidator = (item, selector, params) => {
41005
41007
  const value = selector(item);
41006
- const values = Array.isArray(value) ? value : [value];
41008
+ const values = Array.isArray(value)
41009
+ ? value.filter(Boolean)
41010
+ : [value].filter(Boolean);
41007
41011
  const isRequiredValid = params.required
41008
41012
  ? values.length > 0 &&
41009
41013
  values.every((v) => typeof v === "string" && v.length > 0)