@mikro-orm/core 7.0.2-dev.13 → 7.0.2-dev.14
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/EntityManager.d.ts +4 -0
- package/EntityManager.js +4 -0
- package/MikroORM.d.ts +2 -0
- package/MikroORM.js +2 -0
- package/cache/CacheAdapter.d.ts +2 -0
- package/cache/GeneratedCacheAdapter.d.ts +1 -0
- package/cache/GeneratedCacheAdapter.js +1 -0
- package/cache/MemoryCacheAdapter.d.ts +1 -0
- package/cache/MemoryCacheAdapter.js +1 -0
- package/cache/NullCacheAdapter.d.ts +1 -0
- package/cache/NullCacheAdapter.js +1 -0
- package/connections/Connection.d.ts +13 -0
- package/connections/Connection.js +9 -0
- package/drivers/DatabaseDriver.d.ts +12 -0
- package/drivers/DatabaseDriver.js +12 -0
- package/drivers/IDatabaseDriver.d.ts +44 -0
- package/drivers/IDatabaseDriver.js +1 -0
- package/entity/BaseEntity.d.ts +11 -0
- package/entity/BaseEntity.js +11 -0
- package/entity/Collection.d.ts +26 -0
- package/entity/Collection.js +15 -0
- package/entity/EntityAssigner.d.ts +3 -0
- package/entity/EntityAssigner.js +2 -0
- package/entity/EntityFactory.d.ts +16 -0
- package/entity/EntityFactory.js +6 -0
- package/entity/EntityLoader.d.ts +19 -0
- package/entity/EntityLoader.js +2 -0
- package/entity/EntityRepository.d.ts +2 -0
- package/entity/EntityRepository.js +2 -0
- package/entity/Reference.d.ts +20 -0
- package/entity/Reference.js +16 -0
- package/entity/WrappedEntity.d.ts +20 -0
- package/entity/WrappedEntity.js +21 -1
- package/entity/defineEntity.d.ts +10 -0
- package/entity/defineEntity.js +1 -0
- package/enums.d.ts +132 -0
- package/enums.js +132 -0
- package/errors.d.ts +6 -0
- package/errors.js +6 -0
- package/events/EventManager.d.ts +5 -0
- package/events/EventManager.js +5 -0
- package/events/EventSubscriber.d.ts +4 -0
- package/events/TransactionEventBroadcaster.d.ts +2 -0
- package/events/TransactionEventBroadcaster.js +2 -0
- package/hydration/Hydrator.d.ts +2 -0
- package/hydration/Hydrator.js +2 -0
- package/hydration/ObjectHydrator.d.ts +1 -0
- package/hydration/ObjectHydrator.js +1 -0
- package/logging/DefaultLogger.d.ts +3 -0
- package/logging/DefaultLogger.js +3 -0
- package/logging/Logger.d.ts +5 -0
- package/metadata/EntitySchema.d.ts +22 -0
- package/metadata/EntitySchema.js +20 -0
- package/metadata/MetadataDiscovery.d.ts +4 -0
- package/metadata/MetadataDiscovery.js +4 -0
- package/metadata/MetadataProvider.d.ts +8 -0
- package/metadata/MetadataProvider.js +8 -0
- package/metadata/MetadataStorage.d.ts +14 -0
- package/metadata/MetadataStorage.js +13 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +1 -0
- package/naming-strategy/AbstractNamingStrategy.js +1 -0
- package/naming-strategy/MongoNamingStrategy.d.ts +1 -0
- package/naming-strategy/MongoNamingStrategy.js +1 -0
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +1 -0
- package/naming-strategy/UnderscoreNamingStrategy.js +1 -0
- package/package.json +1 -1
- package/platforms/ExceptionConverter.d.ts +1 -0
- package/platforms/ExceptionConverter.js +1 -0
- package/platforms/Platform.d.ts +65 -0
- package/platforms/Platform.js +65 -0
- package/serialization/EntitySerializer.d.ts +2 -0
- package/serialization/EntitySerializer.js +2 -0
- package/serialization/EntityTransformer.d.ts +2 -0
- package/serialization/EntityTransformer.js +2 -0
- package/serialization/SerializationContext.d.ts +5 -0
- package/serialization/SerializationContext.js +5 -0
- package/types/ArrayType.d.ts +1 -0
- package/types/ArrayType.js +1 -0
- package/types/BlobType.d.ts +1 -0
- package/types/BlobType.js +1 -0
- package/types/BooleanType.d.ts +1 -0
- package/types/BooleanType.js +1 -0
- package/types/CharacterType.d.ts +1 -0
- package/types/CharacterType.js +1 -0
- package/types/DateTimeType.d.ts +1 -0
- package/types/DateTimeType.js +1 -0
- package/types/DateType.d.ts +1 -0
- package/types/DateType.js +1 -0
- package/types/EnumArrayType.d.ts +1 -0
- package/types/EnumArrayType.js +1 -0
- package/types/EnumType.d.ts +1 -0
- package/types/EnumType.js +1 -0
- package/types/FloatType.d.ts +1 -0
- package/types/FloatType.js +1 -0
- package/types/IntegerType.d.ts +1 -0
- package/types/IntegerType.js +1 -0
- package/types/IntervalType.d.ts +1 -0
- package/types/IntervalType.js +1 -0
- package/types/JsonType.d.ts +1 -0
- package/types/JsonType.js +1 -0
- package/types/MediumIntType.d.ts +1 -0
- package/types/MediumIntType.js +1 -0
- package/types/SmallIntType.d.ts +1 -0
- package/types/SmallIntType.js +1 -0
- package/types/StringType.d.ts +1 -0
- package/types/StringType.js +1 -0
- package/types/TextType.d.ts +1 -0
- package/types/TextType.js +1 -0
- package/types/TimeType.d.ts +1 -0
- package/types/TimeType.js +1 -0
- package/types/TinyIntType.d.ts +1 -0
- package/types/TinyIntType.js +1 -0
- package/types/Type.d.ts +3 -0
- package/types/Type.js +1 -0
- package/types/Uint8ArrayType.d.ts +1 -0
- package/types/Uint8ArrayType.js +1 -0
- package/types/UnknownType.d.ts +1 -0
- package/types/UnknownType.js +1 -0
- package/types/UuidType.d.ts +1 -0
- package/types/UuidType.js +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.js +2 -0
- package/typings.d.ts +177 -0
- package/typings.js +11 -0
- package/unit-of-work/ChangeSet.d.ts +4 -0
- package/unit-of-work/ChangeSet.js +4 -0
- package/unit-of-work/ChangeSetComputer.d.ts +2 -0
- package/unit-of-work/ChangeSetComputer.js +2 -0
- package/unit-of-work/ChangeSetPersister.d.ts +4 -0
- package/unit-of-work/ChangeSetPersister.js +4 -0
- package/unit-of-work/IdentityMap.d.ts +7 -0
- package/unit-of-work/IdentityMap.js +7 -0
- package/unit-of-work/UnitOfWork.d.ts +15 -0
- package/unit-of-work/UnitOfWork.js +15 -0
- package/utils/Configuration.d.ts +8 -0
- package/utils/Configuration.js +8 -0
- package/utils/EntityComparator.d.ts +2 -0
- package/utils/EntityComparator.js +2 -0
- package/utils/NullHighlighter.d.ts +1 -0
- package/utils/NullHighlighter.js +1 -0
- package/utils/RawQueryFragment.d.ts +10 -0
- package/utils/RawQueryFragment.js +9 -0
- package/utils/RequestContext.d.ts +1 -0
- package/utils/TransactionContext.d.ts +1 -0
- package/utils/TransactionContext.js +1 -0
- package/utils/Utils.d.ts +6 -0
- package/utils/Utils.js +7 -1
package/utils/Utils.d.ts
CHANGED
|
@@ -3,15 +3,21 @@ import type { Collection } from '../entity/Collection.js';
|
|
|
3
3
|
import type { Platform } from '../platforms/Platform.js';
|
|
4
4
|
import { type ScalarReference } from '../entity/Reference.js';
|
|
5
5
|
import { type RawQueryFragmentSymbol } from './RawQueryFragment.js';
|
|
6
|
+
/** Deeply compares two objects for equality, handling dates, regexes, and raw fragments. */
|
|
6
7
|
export declare function compareObjects(a: any, b: any): boolean;
|
|
8
|
+
/** Compares two arrays element-by-element for deep equality. */
|
|
7
9
|
export declare function compareArrays(a: any[] | string, b: any[] | string): boolean;
|
|
10
|
+
/** Compares two boolean values, treating numeric 0/1 as false/true. */
|
|
8
11
|
export declare function compareBooleans(a: unknown, b: unknown): boolean;
|
|
12
|
+
/** Compares two byte arrays element-by-element. */
|
|
9
13
|
export declare function compareBuffers(a: Uint8Array, b: Uint8Array): boolean;
|
|
10
14
|
/**
|
|
11
15
|
* Checks if arguments are deeply (but not strictly) equal.
|
|
12
16
|
*/
|
|
13
17
|
export declare function equals(a: any, b: any): boolean;
|
|
18
|
+
/** Parses a JSON string safely, returning the original value if parsing fails. */
|
|
14
19
|
export declare function parseJsonSafe<T = unknown>(value: unknown): T;
|
|
20
|
+
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
15
21
|
export declare class Utils {
|
|
16
22
|
#private;
|
|
17
23
|
static readonly PK_SEPARATOR = "~~~";
|
package/utils/Utils.js
CHANGED
|
@@ -14,6 +14,7 @@ function compareConstructors(a, b) {
|
|
|
14
14
|
}
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
|
+
/** Deeply compares two objects for equality, handling dates, regexes, and raw fragments. */
|
|
17
18
|
export function compareObjects(a, b) {
|
|
18
19
|
if (a === b || (a == null && b == null)) {
|
|
19
20
|
return true;
|
|
@@ -59,6 +60,7 @@ export function compareObjects(a, b) {
|
|
|
59
60
|
}
|
|
60
61
|
return true;
|
|
61
62
|
}
|
|
63
|
+
/** Compares two arrays element-by-element for deep equality. */
|
|
62
64
|
export function compareArrays(a, b) {
|
|
63
65
|
const length = a.length;
|
|
64
66
|
if (length !== b.length) {
|
|
@@ -72,11 +74,13 @@ export function compareArrays(a, b) {
|
|
|
72
74
|
}
|
|
73
75
|
return true;
|
|
74
76
|
}
|
|
77
|
+
/** Compares two boolean values, treating numeric 0/1 as false/true. */
|
|
75
78
|
export function compareBooleans(a, b) {
|
|
76
79
|
a = typeof a === 'number' ? Boolean(a) : a;
|
|
77
80
|
b = typeof b === 'number' ? Boolean(b) : b;
|
|
78
81
|
return a === b;
|
|
79
82
|
}
|
|
83
|
+
/** Compares two byte arrays element-by-element. */
|
|
80
84
|
export function compareBuffers(a, b) {
|
|
81
85
|
const length = a.length;
|
|
82
86
|
if (length !== b.length) {
|
|
@@ -108,6 +112,7 @@ export function equals(a, b) {
|
|
|
108
112
|
return Number.isNaN(a) && Number.isNaN(b);
|
|
109
113
|
}
|
|
110
114
|
const equalsFn = equals;
|
|
115
|
+
/** Parses a JSON string safely, returning the original value if parsing fails. */
|
|
111
116
|
export function parseJsonSafe(value) {
|
|
112
117
|
if (typeof value === 'string') {
|
|
113
118
|
/* v8 ignore next */
|
|
@@ -121,9 +126,10 @@ export function parseJsonSafe(value) {
|
|
|
121
126
|
}
|
|
122
127
|
return value;
|
|
123
128
|
}
|
|
129
|
+
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
124
130
|
export class Utils {
|
|
125
131
|
static PK_SEPARATOR = '~~~';
|
|
126
|
-
static #ORM_VERSION = '7.0.2-dev.
|
|
132
|
+
static #ORM_VERSION = '7.0.2-dev.14';
|
|
127
133
|
/**
|
|
128
134
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
129
135
|
*/
|