@mikro-orm/core 6.6.18 → 6.6.19-dev.0

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/EntityManager.js CHANGED
@@ -1717,7 +1717,13 @@ class EntityManager {
1717
1717
  for (const k of ['ctx', 'strategy', 'flushMode', 'logging', 'loggerContext']) {
1718
1718
  delete opts[k];
1719
1719
  }
1720
- return [entityName, method, opts, where];
1720
+ const key = [entityName, method, opts, where];
1721
+ // filters of the root entity are part of `where`, but those of its relations are applied only when loading them
1722
+ const filterParams = this.getContext(false).filterParams;
1723
+ if (options.filters !== false && utils_1.Utils.hasObjectKeys(filterParams) && utils_1.Utils.asArray(opts.populate).length > 0) {
1724
+ key.push({ filterParams });
1725
+ }
1726
+ return key;
1721
1727
  }
1722
1728
  /**
1723
1729
  * @internal
@@ -41,6 +41,10 @@ class EntityAssigner {
41
41
  if (Utils_1.DANGEROUS_PROPERTY_NAMES.includes(propName)) {
42
42
  return;
43
43
  }
44
+ // keys that are not entity properties must not replace methods of the entity, e.g. `toJSON`
45
+ if (!Object.hasOwn(props, propName) && typeof entity[propName] === 'function') {
46
+ return;
47
+ }
44
48
  let value = data[propName];
45
49
  const onlyProperties = options.onlyProperties && !(propName in props);
46
50
  const ignoreUndefined = options.ignoreUndefined === true && value === undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.6.18",
3
+ "version": "6.6.19-dev.0",
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.3",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.6.18",
67
+ "mikro-orm": "6.6.19-dev.0",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }