*put getter check outside async
This commit is contained in:
parent
a9dcbaecee
commit
26dd88fb5c
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
Reference in New Issue