@punks/backend-entity-manager 0.0.388 → 0.0.389

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 CHANGED
@@ -254,7 +254,7 @@ class EntitySerializer {
254
254
  return records.map((x, i) => this.convertSheetRecord(x, definition, i));
255
255
  }
256
256
  convertSheetRecord(record, definition, rowIndex) {
257
- if (this.options?.useTypeColumn &&
257
+ if (definition.sheet?.useTypeColumn &&
258
258
  (!record._type || record._type !== this.entityName)) {
259
259
  throw new Error(`Invalid record type ${record._type} -> record: \n${JSON.stringify(record)}`);
260
260
  }
@@ -325,7 +325,7 @@ class EntitySerializer {
325
325
  fileName,
326
326
  contentType: "text/csv",
327
327
  content: Buffer.from(backendCore.csvBuild([{}], [
328
- ...(this.options?.useTypeColumn
328
+ ...(definition.sheet?.useTypeColumn
329
329
  ? [
330
330
  {
331
331
  name: "_type",
@@ -349,7 +349,7 @@ class EntitySerializer {
349
349
  data: [{}],
350
350
  sheetName: definition?.sheet?.name ?? this.entityName,
351
351
  columns: [
352
- ...(this.options?.useTypeColumn
352
+ ...(definition.sheet?.useTypeColumn
353
353
  ? [
354
354
  {
355
355
  header: "_type",
@@ -391,7 +391,7 @@ class EntitySerializer {
391
391
  fileName,
392
392
  contentType: "text/csv",
393
393
  content: Buffer.from(backendCore.csvBuild(data, [
394
- ...(this.options?.useTypeColumn
394
+ ...(definition.sheet?.useTypeColumn
395
395
  ? [
396
396
  {
397
397
  name: "_type",