@mikro-orm/core 6.5.8-dev.10 → 6.5.8-dev.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.5.8-dev.10",
3
+ "version": "6.5.8-dev.11",
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.3.2",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.5.8-dev.10",
67
+ "mikro-orm": "6.5.8-dev.11",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }
@@ -98,6 +98,10 @@ class UnitOfWork {
98
98
  }
99
99
  data[prop.name] = Utils_1.Utils.getPrimaryKeyValues(data[prop.name], prop.targetMeta, true);
100
100
  }
101
+ if (prop.hydrate === false && prop.customType?.ensureComparable(wrapped.__meta, prop)) {
102
+ const converted = prop.customType.convertToJSValue(data[key], this.platform);
103
+ data[key] = prop.customType.convertToDatabaseValue(converted, this.platform);
104
+ }
101
105
  if (forceUndefined) {
102
106
  if (data[key] === null) {
103
107
  data[key] = undefined;
@@ -545,10 +545,7 @@ class EntityComparator {
545
545
  context.set('compareObjects', Utils_1.compareObjects);
546
546
  context.set('equals', Utils_1.equals);
547
547
  for (const prop of meta.comparableProps) {
548
- // skip properties that are not hydrated
549
- if (prop.hydrate !== false) {
550
- lines.push(this.getPropertyComparator(prop, context));
551
- }
548
+ lines.push(this.getPropertyComparator(prop, context));
552
549
  }
553
550
  // also compare 1:1 inverse sides, important for `factory.mergeData`
554
551
  lines.push(`if (options?.includeInverseSides) {`);