@mikro-orm/core 6.3.11-dev.9 → 6.3.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/README.md CHANGED
@@ -164,6 +164,7 @@ You can find example integrations for some popular frameworks in the [`mikro-orm
164
164
  - [Accounts.js REST and GraphQL authentication + SQLite](https://github.com/darkbasic/mikro-orm-accounts-example)
165
165
  - [Nest + Shopify + PostgreSQL + GraphQL](https://github.com/Cloudshelf/Shopify_CSConnector)
166
166
  - [Elysia.js + libSQL + Bun](https://github.com/mikro-orm/elysia-bun-example-app)
167
+ - [Electron.js + PostgreSQL](https://github.com/adnanlah/electron-mikro-orm-example-app)
167
168
 
168
169
  ### JavaScript Examples
169
170
 
@@ -215,7 +215,7 @@ class EntityLoader {
215
215
  if (prop.kind === enums_1.ReferenceKind.ONE_TO_MANY || (prop.kind === enums_1.ReferenceKind.MANY_TO_MANY && !prop.owner)) {
216
216
  fk = meta.properties[prop.mappedBy].name;
217
217
  }
218
- if (prop.kind === enums_1.ReferenceKind.ONE_TO_ONE && !prop.owner) {
218
+ if (prop.kind === enums_1.ReferenceKind.ONE_TO_ONE && !prop.owner && !ref) {
219
219
  children.length = 0;
220
220
  fk = meta.properties[prop.mappedBy].name;
221
221
  children.push(...this.filterByReferences(entities, prop.name, options.refresh));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.3.11-dev.9",
3
+ "version": "6.3.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.2.0",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.3.11-dev.9",
67
+ "mikro-orm": "6.3.11",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }
@@ -361,6 +361,7 @@ class Platform {
361
361
  quoteValue(value) {
362
362
  return value;
363
363
  }
364
+ /* istanbul ignore next */
364
365
  escape(value) {
365
366
  return value;
366
367
  }
@@ -429,6 +429,7 @@ class EntityComparator {
429
429
  registerCustomType(prop, context) {
430
430
  const convertorKey = this.safeKey(prop.name);
431
431
  context.set(`convertToDatabaseValue_${convertorKey}`, (val) => {
432
+ /* istanbul ignore if */
432
433
  if (RawQueryFragment_1.RawQueryFragment.isKnownFragment(val)) {
433
434
  return val;
434
435
  }
package/utils/Utils.js CHANGED
@@ -49,10 +49,12 @@ function compareObjects(a, b) {
49
49
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
50
50
  return a.sql === b.sql && compareArrays(a.params, b.params);
51
51
  }
52
- if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') {
53
- return a.valueOf() === b.valueOf();
54
- }
55
- if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') {
52
+ if ((typeof a === 'function' && typeof b === 'function') ||
53
+ (typeof a === 'object' && a.client && ['Ref', 'Raw'].includes(a.constructor.name) && typeof b === 'object' && b.client && ['Ref', 'Raw'].includes(b.constructor.name)) || // knex qb
54
+ (a instanceof Date && b instanceof Date) ||
55
+ (a instanceof RegExp && b instanceof RegExp) ||
56
+ (a instanceof String && b instanceof String) ||
57
+ (a instanceof Number && b instanceof Number)) {
56
58
  return a.toString() === b.toString();
57
59
  }
58
60
  const keys = Object.keys(a);