@mikro-orm/core 7.1.0-dev.40 → 7.1.0-dev.41
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/EntityAssigner.js +8 -0
- package/package.json +1 -1
- package/utils/Utils.js +1 -1
package/entity/EntityAssigner.js
CHANGED
|
@@ -99,6 +99,14 @@ export class EntityAssigner {
|
|
|
99
99
|
return EntityAssigner.assignReference(entity, value, prop, options.em, options);
|
|
100
100
|
}
|
|
101
101
|
if (prop.kind === ReferenceKind.SCALAR && SCALAR_TYPES.has(prop.runtimeType) && (prop.setter || !prop.getter)) {
|
|
102
|
+
// mirror the hydrator (used by `em.create`) and coerce string/number inputs to `Date` instances,
|
|
103
|
+
// since `EntityData` already permits `string | Date` for `Date`-typed properties at the type level
|
|
104
|
+
if (prop.runtimeType === 'Date' &&
|
|
105
|
+
value != null &&
|
|
106
|
+
!(value instanceof Date) &&
|
|
107
|
+
(typeof value === 'string' || typeof value === 'number')) {
|
|
108
|
+
value = new Date(value);
|
|
109
|
+
}
|
|
102
110
|
validateProperty(prop, value, entity);
|
|
103
111
|
return (entity[prop.name] = value);
|
|
104
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.1.0-dev.
|
|
3
|
+
"version": "7.1.0-dev.41",
|
|
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.0-dev.
|
|
144
|
+
static #ORM_VERSION = '7.1.0-dev.41';
|
|
145
145
|
/**
|
|
146
146
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
147
147
|
*/
|