fix: allow sync function

This commit is contained in:
Shinwoo PARK 2023-12-15 01:55:52 +09:00
parent 440fae5ef9
commit 434b0ff81f

View File

@ -124,7 +124,7 @@ interface FunctionMetadata {
} }
function overrideBuild<F extends Array<any>, R>( function overrideBuild<F extends Array<any>, R>(
originalFunction: (...args: F) => Promise<R>, originalFunction: (...args: F) => Promise<R> | R,
baseLogger: Logger, baseLogger: Logger,
metadatas: FunctionMetadata, metadatas: FunctionMetadata,
key: string, key: string,
@ -264,7 +264,7 @@ function overrideBuild<F extends Array<any>, R>(
export function LoggedFunction<F extends Array<any>, R>( export function LoggedFunction<F extends Array<any>, R>(
_target: any, _target: any,
key: string, key: string,
descriptor: TypedPropertyDescriptor<(...args: F) => Promise<R>> descriptor: TypedPropertyDescriptor<(...args: F) => Promise<R> | R>
) { ) {
loggerInit(_target); loggerInit(_target);
@ -335,7 +335,7 @@ export function LoggedRoute<F extends Array<any>, R>(route?: string) {
return ( return (
_target: any, _target: any,
key: string, key: string,
descriptor: TypedPropertyDescriptor<(...args: F) => Promise<R>> descriptor: TypedPropertyDescriptor<(...args: F) => Promise<R> | R>
) => { ) => {
loggerInit(_target); loggerInit(_target);