Skip to content

Commit cd646d5

Browse files
Merge pull request #1578 from kerryChen95/master
ref function can return string
2 parents 767c9da + e970aa4 commit cd646d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/factories/definitions.factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ export class DefinitionsFactory {
9494
}
9595
if (typeof optionsOrType?.ref === 'function') {
9696
try {
97-
optionsOrType.ref =
98-
(optionsOrType.ref as Function)()?.name ?? optionsOrType.ref;
97+
const result = (optionsOrType.ref as Function)();
98+
optionsOrType.ref = result?.name ?? result;
9999
} catch (err) {
100100
if (err instanceof TypeError) {
101101
const refClassName = (optionsOrType.ref as Function)?.name;

0 commit comments

Comments
 (0)