@mikro-orm/core 7.0.9-dev.0 → 7.0.9-dev.1
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/entity/Collection.d.ts +2 -1
- package/package.json +1 -1
- package/typings.d.ts +3 -1
- package/typings.js +2 -0
- package/utils/Utils.js +1 -1
package/entity/Collection.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EntityDTO, type EntityKey, type EntityProperty, type FilterQuery, type IPrimaryKey, type Loaded, type LoadedCollection, type Populate, type Primary, CollectionBrand } from '../typings.js';
|
|
2
2
|
import { Reference } from './Reference.js';
|
|
3
3
|
import type { Transaction } from '../connections/Connection.js';
|
|
4
4
|
import type { CountOptions, FindOptions } from '../drivers/IDatabaseDriver.js';
|
|
@@ -17,6 +17,7 @@ export declare class Collection<T extends object, O extends object = object> {
|
|
|
17
17
|
#private;
|
|
18
18
|
readonly owner: O;
|
|
19
19
|
[k: number]: T;
|
|
20
|
+
readonly [CollectionBrand]: true;
|
|
20
21
|
constructor(owner: O, items?: T[], initialized?: boolean);
|
|
21
22
|
/**
|
|
22
23
|
* Creates new Collection instance, assigns it to the owning entity and sets the items to it (propagating them to their inverse sides)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.0.9-dev.
|
|
3
|
+
"version": "7.0.9-dev.1",
|
|
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/typings.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export type MaybePromise<T> = T | Promise<T>;
|
|
|
74
74
|
*/
|
|
75
75
|
type CollectionShape<T = any> = {
|
|
76
76
|
[k: number]: T;
|
|
77
|
-
readonly
|
|
77
|
+
readonly [CollectionBrand]: true;
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
80
80
|
* Structural type for matching LoadedCollection (extends CollectionShape with `$` property).
|
|
@@ -134,6 +134,8 @@ export type DeepPartial<T> = T & {
|
|
|
134
134
|
export declare const EntityRepositoryType: unique symbol;
|
|
135
135
|
/** Symbol used to declare the primary key property name(s) on an entity (e.g., `[PrimaryKeyProp]?: 'id'`). */
|
|
136
136
|
export declare const PrimaryKeyProp: unique symbol;
|
|
137
|
+
/** Symbol used as a brand on `CollectionShape` to prevent false structural matches with entities that have properties like `owner`. */
|
|
138
|
+
export declare const CollectionBrand: unique symbol;
|
|
137
139
|
/** Symbol used to declare which properties are optional in `em.create()` (e.g., `[OptionalProps]?: 'createdAt'`). */
|
|
138
140
|
export declare const OptionalProps: unique symbol;
|
|
139
141
|
/** Symbol used to declare which relation properties should be eagerly loaded (e.g., `[EagerProps]?: 'author'`). */
|
package/typings.js
CHANGED
|
@@ -9,6 +9,8 @@ import { BaseEntity } from './entity/BaseEntity.js';
|
|
|
9
9
|
export const EntityRepositoryType = Symbol('EntityRepositoryType');
|
|
10
10
|
/** Symbol used to declare the primary key property name(s) on an entity (e.g., `[PrimaryKeyProp]?: 'id'`). */
|
|
11
11
|
export const PrimaryKeyProp = Symbol('PrimaryKeyProp');
|
|
12
|
+
/** Symbol used as a brand on `CollectionShape` to prevent false structural matches with entities that have properties like `owner`. */
|
|
13
|
+
export const CollectionBrand = Symbol('CollectionBrand');
|
|
12
14
|
/** Symbol used to declare which properties are optional in `em.create()` (e.g., `[OptionalProps]?: 'createdAt'`). */
|
|
13
15
|
export const OptionalProps = Symbol('OptionalProps');
|
|
14
16
|
/** Symbol used to declare which relation properties should be eagerly loaded (e.g., `[EagerProps]?: 'author'`). */
|
package/utils/Utils.js
CHANGED
|
@@ -132,7 +132,7 @@ export function parseJsonSafe(value) {
|
|
|
132
132
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
133
133
|
export class Utils {
|
|
134
134
|
static PK_SEPARATOR = '~~~';
|
|
135
|
-
static #ORM_VERSION = '7.0.9-dev.
|
|
135
|
+
static #ORM_VERSION = '7.0.9-dev.1';
|
|
136
136
|
/**
|
|
137
137
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
138
138
|
*/
|