@mikro-orm/core 7.0.10-dev.3 → 7.0.10-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/metadata/MetadataDiscovery.js +1 -1
- package/package.json +1 -1
- package/utils/Utils.js +5 -3
|
@@ -393,7 +393,7 @@ export class MetadataDiscovery {
|
|
|
393
393
|
}
|
|
394
394
|
if (prop.joinColumns.length > 1) {
|
|
395
395
|
prop.ownColumns = prop.joinColumns.filter(col => {
|
|
396
|
-
return !meta.props.find(p => p.name !== prop.name &&
|
|
396
|
+
return !meta.props.find(p => p.name !== prop.name && p.fieldNames?.includes(col));
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
if (!prop.ownColumns || prop.ownColumns.length === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.0.10-dev.
|
|
3
|
+
"version": "7.0.10-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
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
package/utils/Utils.js
CHANGED
|
@@ -132,7 +132,7 @@ export function parseJsonSafe(value) {
|
|
|
132
132
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
133
133
|
export class Utils {
|
|
134
134
|
static PK_SEPARATOR = '~~~';
|
|
135
|
-
static #ORM_VERSION = '7.0.10-dev.
|
|
135
|
+
static #ORM_VERSION = '7.0.10-dev.5';
|
|
136
136
|
/**
|
|
137
137
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
138
138
|
*/
|
|
@@ -647,8 +647,10 @@ export class Utils {
|
|
|
647
647
|
* Extracts all possible values of a TS enum. Works with both string and numeric enums.
|
|
648
648
|
*/
|
|
649
649
|
static extractEnumValues(target) {
|
|
650
|
-
|
|
651
|
-
const
|
|
650
|
+
// skip namespace-merged functions (GH #7500)
|
|
651
|
+
const entries = Object.entries(target).filter(([, v]) => typeof v !== 'function');
|
|
652
|
+
const keys = entries.map(([k]) => k);
|
|
653
|
+
const values = entries.map(([, v]) => v);
|
|
652
654
|
const numeric = !!values.find(v => typeof v === 'number');
|
|
653
655
|
const constEnum = values.length % 2 === 0 && // const enum will have even number of items
|
|
654
656
|
values.slice(0, values.length / 2).every(v => typeof v === 'string') && // first half are strings
|