@mikro-orm/core 6.3.4-dev.7 → 6.3.4-dev.8

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.
@@ -75,20 +75,12 @@ class EntityLoader {
75
75
  return this.mergeNestedPopulate(normalized);
76
76
  }
77
77
  setSerializationContext(entities, populate, options) {
78
- const exclude = options.exclude ?? [];
79
78
  for (const entity of entities) {
80
- const context = (0, wrap_1.helper)(entity).__serializationContext;
81
- context.populate = context.populate ? context.populate.concat(populate) : populate;
82
- context.exclude = context.exclude ? context.exclude.concat(exclude) : exclude;
83
- if (context.fields && options.fields) {
84
- options.fields.forEach(f => context.fields.add(f));
85
- }
86
- else if (options.fields) {
87
- context.fields = new Set(options.fields);
88
- }
89
- else {
90
- context.fields = new Set([enums_1.PopulatePath.ALL]);
91
- }
79
+ (0, wrap_1.helper)(entity).setSerializationContext({
80
+ populate,
81
+ fields: options.fields,
82
+ exclude: options.exclude,
83
+ });
92
84
  }
93
85
  }
94
86
  /**
package/entity/utils.js CHANGED
@@ -24,6 +24,7 @@ function expandDotPaths(meta, populate, normalized = false) {
24
24
  if (typeof field === 'string') {
25
25
  return { field };
26
26
  }
27
+ /* istanbul ignore next */
27
28
  return typeof field === 'boolean' || field.field === enums_1.PopulatePath.ALL
28
29
  ? { all: !!field, field: meta.primaryKeys[0] }
29
30
  : field;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.3.4-dev.7",
3
+ "version": "6.3.4-dev.8",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -64,7 +64,7 @@
64
64
  "esprima": "4.0.1",
65
65
  "fs-extra": "11.2.0",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.3.4-dev.7",
67
+ "mikro-orm": "6.3.4-dev.8",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }