Skip to content

Commit

Permalink
ref function can return string
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryChen95 committed Oct 28, 2022
1 parent 212d3b6 commit e970aa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/factories/definitions.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export class DefinitionsFactory {
}
if (typeof optionsOrType?.ref === 'function') {
try {
optionsOrType.ref =
(optionsOrType.ref as Function)()?.name ?? optionsOrType.ref;
const result = (optionsOrType.ref as Function)();
optionsOrType.ref = result?.name ?? result;
} catch (err) {
if (err instanceof TypeError) {
const refClassName = (optionsOrType.ref as Function)?.name;
Expand Down

0 comments on commit e970aa4

Please sign in to comment.