@mikro-orm/core 6.3.7-dev.8 → 6.3.8-dev.0
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 +2 -2
- package/utils/clone.js +18 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.8-dev.0",
|
|
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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.2.0",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.3.
|
|
67
|
+
"mikro-orm": "6.3.8-dev.0",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/utils/clone.js
CHANGED
|
@@ -8,6 +8,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.clone = clone;
|
|
9
9
|
const node_events_1 = require("node:events");
|
|
10
10
|
const RawQueryFragment_1 = require("./RawQueryFragment");
|
|
11
|
+
/**
|
|
12
|
+
* Get the property descriptor of a property on an object or its prototype chain.
|
|
13
|
+
*
|
|
14
|
+
* @param obj - The object to get the property descriptor from.
|
|
15
|
+
* @param prop - The property to get the descriptor for.
|
|
16
|
+
*/
|
|
17
|
+
function getPropertyDescriptor(obj, prop) {
|
|
18
|
+
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
19
|
+
if (descriptor) {
|
|
20
|
+
return descriptor;
|
|
21
|
+
}
|
|
22
|
+
const proto = Object.getPrototypeOf(obj);
|
|
23
|
+
if (proto) {
|
|
24
|
+
return getPropertyDescriptor(proto, prop);
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
11
28
|
function clone(parent, respectCustomCloneMethod = true) {
|
|
12
29
|
const allParents = [];
|
|
13
30
|
const allChildren = [];
|
|
@@ -95,7 +112,7 @@ function clone(parent, respectCustomCloneMethod = true) {
|
|
|
95
112
|
for (const i in parent) {
|
|
96
113
|
let attrs;
|
|
97
114
|
if (proto) {
|
|
98
|
-
attrs =
|
|
115
|
+
attrs = getPropertyDescriptor(proto, i);
|
|
99
116
|
}
|
|
100
117
|
if (attrs && attrs.set == null) {
|
|
101
118
|
continue;
|