@mikro-orm/core 7.1.9-dev.3 → 7.1.9-dev.4

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.
@@ -364,6 +364,9 @@ export class ObjectHydrator extends Hydrator {
364
364
  ret.push(` data${dataKey}.forEach((_, idx_${idx}) => {`);
365
365
  ret.push(...hydrateEmbedded(prop, [...path, `[idx_${idx}]`], `${dataKey}[idx_${idx}]`).map(l => ' ' + l));
366
366
  ret.push(` });`);
367
+ ret.push(` } else if (data${dataKey} === null) {`);
368
+ /* v8 ignore next */
369
+ ret.push(` entity${entityKey} = ${this.config.get('forceUndefined') ? 'undefined' : 'null'};`);
367
370
  ret.push(` }`);
368
371
  return ret;
369
372
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.1.9-dev.3",
3
+ "version": "7.1.9-dev.4",
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
  "keywords": [
6
6
  "data-mapper",
@@ -447,6 +447,7 @@ export class EntityComparator {
447
447
  const ret = [];
448
448
  const padding = ' '.repeat(level * 2);
449
449
  const idx = this.#tmpIndex++;
450
+ ret.push(`${padding}if (entity${entityKey} === null) ret${dataKey} = null;`);
450
451
  ret.push(`${padding}if (Array.isArray(entity${entityKey})) {`);
451
452
  ret.push(`${padding} ret${dataKey} = [];`);
452
453
  ret.push(`${padding} entity${entityKey}.forEach((_, idx_${idx}) => {`);
package/utils/Utils.js CHANGED
@@ -153,7 +153,7 @@ export function parseJsonSafe(value) {
153
153
  /** Collection of general-purpose utility methods used throughout the ORM. */
154
154
  export class Utils {
155
155
  static PK_SEPARATOR = '~~~';
156
- static #ORM_VERSION = '7.1.9-dev.3';
156
+ static #ORM_VERSION = '7.1.9-dev.4';
157
157
  /**
158
158
  * Checks if the argument is instance of `Object`. Returns false for arrays.
159
159
  */