@mikro-orm/core 6.6.8-dev.3 → 6.6.8-dev.5
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.js +1 -1
- package/package.json +3 -3
- package/unit-of-work/UnitOfWork.js +2 -2
- package/utils/Utils.js +2 -2
package/EntityManager.js
CHANGED
|
@@ -1160,7 +1160,7 @@ class EntityManager {
|
|
|
1160
1160
|
const data = this.driver.mapResult(result, meta);
|
|
1161
1161
|
Object.keys(data).forEach(k => {
|
|
1162
1162
|
const prop = meta.properties[k];
|
|
1163
|
-
if (prop
|
|
1163
|
+
if (prop?.kind === enums_1.ReferenceKind.SCALAR && enums_1.SCALAR_TYPES.includes(prop.runtimeType) && !prop.customType && (prop.setter || !prop.getter)) {
|
|
1164
1164
|
data[k] = this.validator.validateProperty(prop, data[k], data);
|
|
1165
1165
|
}
|
|
1166
1166
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.6.8-dev.
|
|
3
|
+
"version": "6.6.8-dev.5",
|
|
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
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"dataloader": "2.2.3",
|
|
63
|
-
"dotenv": "17.
|
|
63
|
+
"dotenv": "17.3.1",
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.3.3",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.6.8-dev.
|
|
67
|
+
"mikro-orm": "6.6.8-dev.5",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -836,7 +836,7 @@ class UnitOfWork {
|
|
|
836
836
|
if (Utils_1.Utils.isCollection(ref)) {
|
|
837
837
|
ref.getItems(false).some(item => {
|
|
838
838
|
const cs = this.changeSets.get(entity_1.Reference.unwrapReference(item));
|
|
839
|
-
const isScheduledForInsert = cs
|
|
839
|
+
const isScheduledForInsert = cs?.type === ChangeSet_1.ChangeSetType.CREATE && !cs.persisted;
|
|
840
840
|
if (isScheduledForInsert) {
|
|
841
841
|
this.scheduleExtraUpdate(changeSet, [prop]);
|
|
842
842
|
return true;
|
|
@@ -845,7 +845,7 @@ class UnitOfWork {
|
|
|
845
845
|
});
|
|
846
846
|
}
|
|
847
847
|
const cs = this.changeSets.get(entity_1.Reference.unwrapReference(ref));
|
|
848
|
-
const isScheduledForInsert = cs
|
|
848
|
+
const isScheduledForInsert = cs?.type === ChangeSet_1.ChangeSetType.CREATE && !cs.persisted;
|
|
849
849
|
if (isScheduledForInsert) {
|
|
850
850
|
this.scheduleExtraUpdate(changeSet, [prop]);
|
|
851
851
|
}
|
package/utils/Utils.js
CHANGED
|
@@ -433,7 +433,7 @@ class Utils {
|
|
|
433
433
|
return true;
|
|
434
434
|
}
|
|
435
435
|
if (Utils.isObject(key)) {
|
|
436
|
-
if (key.constructor
|
|
436
|
+
if (key.constructor?.name.toLowerCase() === 'objectid') {
|
|
437
437
|
return true;
|
|
438
438
|
}
|
|
439
439
|
if (!Utils.isPlainObject(key) && !Utils.isEntity(key, true)) {
|
|
@@ -625,7 +625,7 @@ class Utils {
|
|
|
625
625
|
* Checks whether the argument is ObjectId instance
|
|
626
626
|
*/
|
|
627
627
|
static isObjectID(key) {
|
|
628
|
-
return Utils.isObject(key) && key.constructor
|
|
628
|
+
return Utils.isObject(key) && key.constructor?.name.toLowerCase() === 'objectid';
|
|
629
629
|
}
|
|
630
630
|
/**
|
|
631
631
|
* Checks whether the argument is empty (array without items, object without keys or falsy value).
|