@mikro-orm/reflection 6.5.10-dev.23 → 6.5.10-dev.24
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/TsMorphMetadataProvider.js +16 -1
- package/package.json +2 -2
|
@@ -82,7 +82,22 @@ class TsMorphMetadataProvider extends core_1.MetadataProvider {
|
|
|
82
82
|
throw new core_1.MetadataError(`Source class for entity ${meta.className} not found. Verify you have 'compilerOptions.declaration' enabled in your 'tsconfig.json'. If you are using webpack, see https://bit.ly/35pPDNn`);
|
|
83
83
|
}
|
|
84
84
|
const properties = cls.getInstanceProperties();
|
|
85
|
-
const property = properties.find(v =>
|
|
85
|
+
const property = properties.find(v => {
|
|
86
|
+
if (v.getName() === prop.name) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
const nameNode = v.getNameNode();
|
|
90
|
+
if (nameNode instanceof ts_morph_1.StringLiteral && nameNode.getLiteralText() === prop.name) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
if (nameNode instanceof ts_morph_1.ComputedPropertyName) {
|
|
94
|
+
const expr = nameNode.getExpression();
|
|
95
|
+
if (expr instanceof ts_morph_1.NoSubstitutionTemplateLiteral && expr.getLiteralText() === prop.name) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
});
|
|
86
101
|
if (!property) {
|
|
87
102
|
return { type: prop.type, optional: prop.nullable };
|
|
88
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/reflection",
|
|
3
|
-
"version": "6.5.10-dev.
|
|
3
|
+
"version": "6.5.10-dev.24",
|
|
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",
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
"@mikro-orm/core": "^6.5.9"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@mikro-orm/core": "6.5.10-dev.
|
|
68
|
+
"@mikro-orm/core": "6.5.10-dev.24"
|
|
69
69
|
}
|
|
70
70
|
}
|