@mikro-orm/core 7.0.0-dev.190 → 7.0.0-dev.191
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/package.json +1 -1
- package/typings.d.ts +20 -5
- package/utils/Utils.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.191",
|
|
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",
|
package/typings.d.ts
CHANGED
|
@@ -820,11 +820,26 @@ export type IsSubset<T, U> = keyof U extends keyof T ? {} : string extends keyof
|
|
|
820
820
|
};
|
|
821
821
|
declare const __selectedType: unique symbol;
|
|
822
822
|
declare const __loadedType: unique symbol;
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
823
|
+
/**
|
|
824
|
+
* Fast check if T is a Loaded type by looking for the marker symbol.
|
|
825
|
+
* This is much cheaper than matching against the full Loaded structure.
|
|
826
|
+
*/
|
|
827
|
+
type IsLoadedType<T> = T extends {
|
|
828
|
+
[__loadedType]?: any;
|
|
829
|
+
} ? true : false;
|
|
830
|
+
/**
|
|
831
|
+
* Optimized MergeSelected using intersection instead of extraction.
|
|
832
|
+
* When T is already Loaded, we intersect with a new Loaded type for the selected fields.
|
|
833
|
+
* This avoids the expensive pattern matching needed to extract hints from Loaded types.
|
|
834
|
+
*/
|
|
835
|
+
export type MergeSelected<T, U, F extends string> = IsLoadedType<T> extends true ? T & Loaded<U, never, F, never> : T;
|
|
836
|
+
/**
|
|
837
|
+
* Optimized MergeLoaded using intersection instead of extraction.
|
|
838
|
+
* When T is already Loaded, we intersect with a new Loaded type for the additional hints.
|
|
839
|
+
* This avoids the expensive pattern matching needed to extract hints from Loaded types.
|
|
840
|
+
* Used for `em.populate` and `em.refresh`.
|
|
841
|
+
*/
|
|
842
|
+
export type MergeLoaded<T, U, P extends string, F extends string, E extends string, R extends boolean = false> = IsLoadedType<T> extends true ? T & Loaded<U, P, F, E> : Loaded<T, P, F, E>;
|
|
828
843
|
export type AddOptional<T> = undefined | null extends T ? null | undefined : null extends T ? null : undefined extends T ? undefined : never;
|
|
829
844
|
type LoadedProp<T, L extends string = never, F extends string = '*', E extends string = never> = LoadedLoadable<T, Loaded<ExtractType<T>, L, F, E>>;
|
|
830
845
|
export type AddEager<T> = ExtractEagerProps<T> & string;
|
package/utils/Utils.js
CHANGED
|
@@ -123,7 +123,7 @@ export function parseJsonSafe(value) {
|
|
|
123
123
|
}
|
|
124
124
|
export class Utils {
|
|
125
125
|
static PK_SEPARATOR = '~~~';
|
|
126
|
-
static #ORM_VERSION = '7.0.0-dev.
|
|
126
|
+
static #ORM_VERSION = '7.0.0-dev.191';
|
|
127
127
|
/**
|
|
128
128
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
129
129
|
*/
|