Skip to content

Commit 749d118

Browse files
committed
feat(type): update extractTypeNameFromFunction to match external library imports
1 parent 0283044 commit 749d118

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/type/src/reflection/reflection.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,10 @@ export class ReflectionClass<T> {
14351435

14361436
export function extractTypeNameFromFunction(fn: Function): string {
14371437
const str = fn.toString();
1438-
//either it starts with __Ω* or __\u{3a9}* (bun.js)
1439-
const match = str.match(/(?:__Ω|__\\u\{3a9\})([\w]+)/);
1438+
// either it starts with
1439+
// __Ω* or __ɵΩ* (node.js)
1440+
// __\u{3a9}* or __\u{275}\u{3a9}* (bun.js)
1441+
const match = str.match(/(?:__Ω|__\\u\{3a9\}|__ɵΩ|__\\u{275}\\u{3a9}*)([\w]+)/);
14401442
if (match) {
14411443
return match[1];
14421444
}

0 commit comments

Comments
 (0)