diff --git a/src/index.ts b/src/index.ts index df4479b..fbcef9e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -147,13 +147,12 @@ export const factory = function ( if (typeof prop !== "function") { return prop; } - } - return async (...args: any[]): Promise => { - await target.loadLibs(module); - if (desc?.get) { return target[property as keyof T]; } + } + return async (...args: any[]): Promise => { + await target.loadLibs(module); return (target[property as keyof T] as Function)(...args); };