@mikro-orm/core 7.0.14-dev.0 → 7.0.14-dev.2

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
@@ -1192,9 +1192,6 @@ export class EntityManager {
1192
1192
  helper(data).setSchema(options.schema);
1193
1193
  }
1194
1194
  if (!helper(data).__managed) {
1195
- // the entity might have been created via `em.create()`, which adds it to the persist stack automatically
1196
- em.#unitOfWork.getPersistStack().delete(data);
1197
- // it can be also in the identity map if it had a PK value already
1198
1195
  em.#unitOfWork.unsetIdentity(data);
1199
1196
  }
1200
1197
  const meta = helper(data).__meta;
@@ -1235,9 +1232,6 @@ export class EntityManager {
1235
1232
  helper(row).setSchema(options.schema);
1236
1233
  }
1237
1234
  if (!helper(row).__managed) {
1238
- // the entity might have been created via `em.create()`, which adds it to the persist stack automatically
1239
- em.#unitOfWork.getPersistStack().delete(row);
1240
- // it can be also in the identity map if it had a PK value already
1241
1235
  em.#unitOfWork.unsetIdentity(row);
1242
1236
  }
1243
1237
  const payload = em.#comparator.prepareEntity(row);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.0.14-dev.0",
3
+ "version": "7.0.14-dev.2",
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",
@@ -10,7 +10,7 @@ function isVisible(meta, propName, options) {
10
10
  return prop.groups.some(g => options.groups.includes(g));
11
11
  }
12
12
  if (Array.isArray(options.populate) &&
13
- options.populate?.find(item => item === propName || item.startsWith(propName + '.') || item === '*')) {
13
+ options.populate?.find(item => item === propName || item.startsWith(propName + '.'))) {
14
14
  return true;
15
15
  }
16
16
  if (options.exclude?.find(item => item === propName)) {
@@ -474,6 +474,9 @@ export class UnitOfWork {
474
474
  }
475
475
  unsetIdentity(entity) {
476
476
  this.#identityMap.delete(entity);
477
+ this.#persistStack.delete(entity);
478
+ this.#removeStack.delete(entity);
479
+ this.#orphanRemoveStack.delete(entity);
477
480
  const wrapped = helper(entity);
478
481
  const serializedPK = wrapped.getSerializedPrimaryKey();
479
482
  // remove references of this entity in all managed entities, otherwise flushing could reinsert the entity
package/utils/Utils.js CHANGED
@@ -141,7 +141,7 @@ export function parseJsonSafe(value) {
141
141
  /** Collection of general-purpose utility methods used throughout the ORM. */
142
142
  export class Utils {
143
143
  static PK_SEPARATOR = '~~~';
144
- static #ORM_VERSION = '7.0.14-dev.0';
144
+ static #ORM_VERSION = '7.0.14-dev.2';
145
145
  /**
146
146
  * Checks if the argument is instance of `Object`. Returns false for arrays.
147
147
  */