From 071fdc2fb08303831e18378dfa10ae482d637aec Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 25 Mar 2023 09:22:18 -0400 Subject: [PATCH] *Revert as we cannot properly detect all edge cases --- src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index c6ec911..7cc1236 100644 --- a/src/index.ts +++ b/src/index.ts @@ -148,12 +148,14 @@ export const factory = function ( return prop; } } - if (desc?.get) { - return target[property as keyof T]; - } + return async (...args: any[]): Promise => { await target.loadLibs(module); + if (desc?.get) { + return target[property as keyof T]; + } + return (target[property as keyof T] as Function)(...args); }; },