*put getter check outside async

This commit is contained in:
Derrick Hammer 2023-03-24 16:43:57 -04:00
parent a9dcbaecee
commit 26dd88fb5c
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 4 deletions

View File

@ -147,13 +147,12 @@ export const factory = function <T extends Client = Client>(
if (typeof prop !== "function") { if (typeof prop !== "function") {
return prop; return prop;
} }
}
return async (...args: any[]): Promise<any> => {
await target.loadLibs(module);
if (desc?.get) { if (desc?.get) {
return target[property as keyof T]; return target[property as keyof T];
} }
}
return async (...args: any[]): Promise<any> => {
await target.loadLibs(module);
return (target[property as keyof T] as Function)(...args); return (target[property as keyof T] as Function)(...args);
}; };