@mikro-orm/decorators 7.0.0-dev.106 → 7.0.0-dev.108
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.d.ts +1 -1
- package/utils.js +4 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/decorators",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.108",
|
|
5
5
|
"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.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@mikro-orm/core": "^6.6.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
58
|
+
"@mikro-orm/core": "7.0.0-dev.108",
|
|
59
59
|
"reflect-metadata": "^0.1.0 || ^0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
package/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Dictionary, EntityManager, type EntityMetadata, EntityRepository, type MaybePromise, MetadataStorage, MikroORM, type ReferenceKind } from '@mikro-orm/core';
|
|
2
2
|
/**
|
|
3
3
|
* The type of context that the user intends to inject.
|
|
4
4
|
*/
|
package/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EntityManager, EntityRepository, MetadataError, MetadataStorage, MikroORM, Utils, } from '@mikro-orm/core';
|
|
2
2
|
function getEntityManager(caller, context) {
|
|
3
3
|
if (context instanceof EntityManager) {
|
|
4
4
|
return context;
|
|
@@ -77,7 +77,7 @@ export function lookupPathFromDecorator(name, stack) {
|
|
|
77
77
|
if (line === -1) {
|
|
78
78
|
// here we handle bun which stack is different from nodejs so we search for reflect-metadata
|
|
79
79
|
// Different bun versions might have different stack traces. The "last index" works for both 1.2.6 and 1.2.7.
|
|
80
|
-
const reflectLine = stack.findLastIndex(line =>
|
|
80
|
+
const reflectLine = stack.findLastIndex(line => line.replace(/\\/g, '/').includes('node_modules/reflect-metadata/Reflect.js'));
|
|
81
81
|
if (reflectLine === -1 || reflectLine + 2 >= stack.length || !stack[reflectLine + 1].includes('bun:wrap')) {
|
|
82
82
|
return name;
|
|
83
83
|
}
|
|
@@ -86,12 +86,12 @@ export function lookupPathFromDecorator(name, stack) {
|
|
|
86
86
|
if (stack[line].includes('Reflect.decorate')) {
|
|
87
87
|
line++;
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
89
|
+
if (stack[line].replace(/\\/g, '/').includes('node_modules/tslib/tslib')) {
|
|
90
90
|
line++;
|
|
91
91
|
}
|
|
92
92
|
try {
|
|
93
93
|
const re = stack[line].match(/\(.+\)/i) ? /\((.*):\d+:\d+\)/ : /at\s*(.*):\d+:\d+$/;
|
|
94
|
-
return
|
|
94
|
+
return stack[line].match(re)[1];
|
|
95
95
|
}
|
|
96
96
|
catch {
|
|
97
97
|
return name;
|