@mikro-orm/decorators 7.0.0-rc.0 → 7.0.0-rc.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/es/Property.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { type PropertyOptions } from '@mikro-orm/core';
2
- export declare function Property<T extends object>(options?: PropertyOptions<T>): (value: unknown, context: ClassFieldDecoratorContext<T> | ClassGetterDecoratorContext<T> | ClassMethodDecoratorContext<T>) => void;
2
+ export declare function Property<T extends object>(options?: PropertyOptions<T>): (value: unknown, context: ClassFieldDecoratorContext<T> | ClassGetterDecoratorContext<T> | ClassSetterDecoratorContext<T> | ClassAccessorDecoratorContext<T> | ClassMethodDecoratorContext<T>) => void;
package/es/Property.js CHANGED
@@ -15,6 +15,21 @@ export function Property(options = {}) {
15
15
  prop.getter = false;
16
16
  prop.setter = false;
17
17
  }
18
+ else if (context.kind === 'getter') {
19
+ prop.name = context.name;
20
+ prop.getter = true;
21
+ prop.setter = false;
22
+ }
23
+ else if (context.kind === 'setter') {
24
+ prop.name = context.name;
25
+ prop.getter = false;
26
+ prop.setter = true;
27
+ }
28
+ else if (context.kind === 'accessor') {
29
+ prop.name = context.name;
30
+ prop.getter = true;
31
+ prop.setter = true;
32
+ }
18
33
  else if (context.kind === 'method') {
19
34
  prop.getter = true;
20
35
  prop.persist = false;
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-rc.0",
4
+ "version": "7.0.0-rc.2",
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-rc.0",
58
+ "@mikro-orm/core": "7.0.0-rc.2",
59
59
  "reflect-metadata": "^0.1.0 || ^0.2.0"
60
60
  },
61
61
  "peerDependenciesMeta": {
package/utils.d.ts CHANGED
@@ -33,7 +33,7 @@ export declare function validateSingleDecorator(meta: EntityMetadata, propertyNa
33
33
  * We need to use the `Object.hasOwn` here, since the metadata object respects inheritance, and the `properties` object might already
34
34
  * exist for some base entity.
35
35
  */
36
- export declare function prepareMetadataContext<T>(context: ClassFieldDecoratorContext<T> | ClassGetterDecoratorContext<T> | ClassMethodDecoratorContext<T>, kind?: ReferenceKind): EntityMetadata<T>;
36
+ export declare function prepareMetadataContext<T>(context: ClassFieldDecoratorContext<T> | ClassGetterDecoratorContext<T> | ClassSetterDecoratorContext<T> | ClassAccessorDecoratorContext<T> | ClassMethodDecoratorContext<T>, kind?: ReferenceKind): EntityMetadata<T>;
37
37
  /**
38
38
  * Uses some dark magic to get source path to caller where decorator is used.
39
39
  * Analyzes stack trace of error created inside the function call.