@mikro-orm/core 7.0.0-dev.165 → 7.0.0-dev.166
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 +8 -1
- 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.166",
|
|
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
|
@@ -41,6 +41,11 @@ export type IsAny<T> = 0 extends (1 & T) ? true : false;
|
|
|
41
41
|
export type IsNever<T, True = true, False = false> = [T] extends [never] ? True : False;
|
|
42
42
|
export type MaybePromise<T> = T | Promise<T>;
|
|
43
43
|
export type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
44
|
+
export type UnionKeys<T> = T extends any ? keyof T : never;
|
|
45
|
+
export type UnionPropertyType<T, K extends PropertyKey> = T extends any ? K extends keyof T ? T[K] : never : never;
|
|
46
|
+
export type MergeUnion<T> = [T] extends [object] ? T extends Scalar ? T : {
|
|
47
|
+
[K in UnionKeys<T>]: UnionPropertyType<T, K>;
|
|
48
|
+
} : T;
|
|
44
49
|
export type DeepPartial<T> = T & {
|
|
45
50
|
[P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends Readonly<infer U>[] ? Readonly<DeepPartial<U>>[] : DeepPartial<T[P]>;
|
|
46
51
|
};
|
|
@@ -154,8 +159,10 @@ export type OperatorMap<T> = {
|
|
|
154
159
|
};
|
|
155
160
|
export type FilterItemValue<T> = T | ExpandScalar<T> | Primary<T>;
|
|
156
161
|
export type FilterValue<T> = OperatorMap<FilterItemValue<T>> | FilterItemValue<T> | FilterItemValue<T>[] | null;
|
|
162
|
+
type FilterObjectProp<T, K extends PropertyKey> = K extends keyof MergeUnion<T> ? MergeUnion<T>[K] : K extends keyof T ? T[K] : never;
|
|
163
|
+
type ExpandQueryMerged<T> = [T] extends [object] ? [T] extends [Scalar] ? never : FilterQuery<MergeUnion<T>> : FilterValue<T>;
|
|
157
164
|
export type FilterObject<T> = {
|
|
158
|
-
-readonly [K in EntityKey<T>]?: ExpandQuery<ExpandProperty<T
|
|
165
|
+
-readonly [K in EntityKey<T> | EntityKey<MergeUnion<T>>]?: ExpandQuery<ExpandProperty<FilterObjectProp<T, K>>> | ExpandQueryMerged<ExpandProperty<FilterObjectProp<T, K>>> | FilterValue<ExpandProperty<FilterObjectProp<T, K>>> | null;
|
|
159
166
|
};
|
|
160
167
|
export type ExpandQuery<T> = T extends object ? T extends Scalar ? never : FilterQuery<T> : FilterValue<T>;
|
|
161
168
|
export type EntityProps<T> = {
|
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.166';
|
|
127
127
|
/**
|
|
128
128
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
129
129
|
*/
|