@mikro-orm/core 7.1.4-dev.11 → 7.1.4-dev.12

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.
@@ -81,7 +81,7 @@ export interface PropertyChain<Value, Options> {
81
81
  fieldName<T extends string>(fieldName: T): PropertyChain<Value, Omit<Options, 'fieldName'> & {
82
82
  fieldName: T;
83
83
  }>;
84
- onCreate(onCreate: (entity: any, em: EntityManager) => Value): PropertyChain<Value, Options & {
84
+ onCreate(onCreate: (entity: any, em: EntityManager) => MaybeArray<Value, Options>): PropertyChain<Value, Options & {
85
85
  onCreate: (...args: any[]) => any;
86
86
  }>;
87
87
  default(defaultValue: string | string[] | number | number[] | boolean | null | Date | Raw): PropertyChain<Value, Omit<Options, 'default'> & {
@@ -93,7 +93,7 @@ export interface PropertyChain<Value, Options> {
93
93
  formula(formula: string | FormulaCallback<any>): PropertyChain<Value, Omit<Options, 'formula'> & {
94
94
  formula: any;
95
95
  }>;
96
- onUpdate(onUpdate: (entity: any, em: EntityManager) => Value): PropertyChain<Value, Options>;
96
+ onUpdate(onUpdate: (entity: any, em: EntityManager) => MaybeArray<Value, Options>): PropertyChain<Value, Options>;
97
97
  fieldNames(...fieldNames: string[]): PropertyChain<Value, Options>;
98
98
  type(type: PropertyValueType): PropertyChain<Value, Options>;
99
99
  runtimeType(runtimeType: string): PropertyChain<Value, Options>;
@@ -271,13 +271,13 @@ export declare class UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys
271
271
  /**
272
272
  * Automatically set the property value when entity gets created, executed during flush operation.
273
273
  */
274
- onCreate(onCreate: (entity: any, em: EntityManager) => Value): Pick<UniversalPropertyOptionsBuilder<Value, Options & {
274
+ onCreate(onCreate: (entity: any, em: EntityManager) => MaybeArray<Value, Options>): Pick<UniversalPropertyOptionsBuilder<Value, Options & {
275
275
  onCreate: (...args: any[]) => any;
276
276
  }, IncludeKeys>, IncludeKeys>;
277
277
  /**
278
278
  * Automatically update the property value every time entity gets updated, executed during flush operation.
279
279
  */
280
- onUpdate(onUpdate: (entity: any, em: EntityManager) => Value): Pick<UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys>, IncludeKeys>;
280
+ onUpdate(onUpdate: (entity: any, em: EntityManager) => MaybeArray<Value, Options>): Pick<UniversalPropertyOptionsBuilder<Value, Options, IncludeKeys>, IncludeKeys>;
281
281
  /**
282
282
  * Specify default column value for {@link https://mikro-orm.io/docs/schema-generator Schema Generator}.
283
283
  * This is a runtime value, assignable to the entity property. (SQL only)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.1.4-dev.11",
3
+ "version": "7.1.4-dev.12",
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",
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.1.4-dev.11';
144
+ static #ORM_VERSION = '7.1.4-dev.12';
145
145
  /**
146
146
  * Checks if the argument is instance of `Object`. Returns false for arrays.
147
147
  */