From e970aa49e0f0b3219f6b0ccd911c22c31c12fc2e Mon Sep 17 00:00:00 2001 From: kerryChen95 <95kerry@gmail.com> Date: Fri, 28 Oct 2022 16:09:33 +0800 Subject: [PATCH] ref function can return string --- lib/factories/definitions.factory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/factories/definitions.factory.ts b/lib/factories/definitions.factory.ts index 1968e868..63126cc2 100644 --- a/lib/factories/definitions.factory.ts +++ b/lib/factories/definitions.factory.ts @@ -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;