@mikro-orm/decorators 7.0.0-dev.140 → 7.0.0-dev.142

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/es/Embeddable.js CHANGED
@@ -1,9 +1,10 @@
1
- import { Utils, } from '@mikro-orm/core';
1
+ import { Utils } from '@mikro-orm/core';
2
2
  import { getMetadataFromDecorator } from '../utils.js';
3
3
  export function Embeddable(options = {}) {
4
4
  return function (target, context) {
5
5
  const meta = getMetadataFromDecorator(target);
6
- Utils.mergeConfig(meta, context.metadata, options);
6
+ const metadata = { ...context.metadata };
7
+ Utils.mergeConfig(meta, metadata, options);
7
8
  meta.class = target;
8
9
  meta.name = meta.class.name;
9
10
  meta.embeddable = true;
package/es/Entity.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { type EntityOptions, type EntityClass, type Constructor } from '@mikro-orm/core';
1
+ import { type Constructor, type EntityOptions, type EntityClass } from '@mikro-orm/core';
2
2
  export declare function Entity<Owner extends EntityClass<unknown> & Constructor>(options?: EntityOptions<Owner>): (target: Owner, context: ClassDecoratorContext<Owner>) => void;
package/es/Entity.js CHANGED
@@ -1,9 +1,10 @@
1
- import { Utils, } from '@mikro-orm/core';
1
+ import { Utils } from '@mikro-orm/core';
2
2
  import { getMetadataFromDecorator } from '../utils.js';
3
3
  export function Entity(options = {}) {
4
4
  return function (target, context) {
5
5
  const meta = getMetadataFromDecorator(target);
6
- Utils.mergeConfig(meta, context.metadata, options);
6
+ const metadata = { ...context.metadata };
7
+ Utils.mergeConfig(meta, metadata, options);
7
8
  meta.class = target;
8
9
  if (!options.abstract || meta.discriminatorColumn) {
9
10
  meta.name = context.name;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mikro-orm/decorators",
3
3
  "type": "module",
4
- "version": "7.0.0-dev.140",
4
+ "version": "7.0.0-dev.142",
5
5
  "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.",
6
6
  "exports": {
7
7
  "./package.json": "./package.json",
@@ -55,7 +55,7 @@
55
55
  "@mikro-orm/core": "^6.6.4"
56
56
  },
57
57
  "peerDependencies": {
58
- "@mikro-orm/core": "7.0.0-dev.140",
58
+ "@mikro-orm/core": "7.0.0-dev.142",
59
59
  "reflect-metadata": "^0.1.0 || ^0.2.0"
60
60
  },
61
61
  "peerDependenciesMeta": {
package/utils.js CHANGED
@@ -68,7 +68,7 @@ export function validateSingleDecorator(meta, propertyName, kind) {
68
68
  export function prepareMetadataContext(context, kind) {
69
69
  const meta = context.metadata;
70
70
  if (!Object.hasOwn(meta, 'properties')) {
71
- meta.properties = {};
71
+ meta.properties = { ...meta.properties };
72
72
  }
73
73
  if (kind) {
74
74
  validateSingleDecorator(meta, context.name, kind);