From 434b0ff81f1a60c7da1f45acd77606a47d5c0d61 Mon Sep 17 00:00:00 2001 From: Shinwoo PARK Date: Fri, 15 Dec 2023 01:55:52 +0900 Subject: [PATCH] fix: allow sync function --- src/logged.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logged.ts b/src/logged.ts index 1aa97a8..b157b85 100644 --- a/src/logged.ts +++ b/src/logged.ts @@ -124,7 +124,7 @@ interface FunctionMetadata { } function overrideBuild, R>( - originalFunction: (...args: F) => Promise, + originalFunction: (...args: F) => Promise | R, baseLogger: Logger, metadatas: FunctionMetadata, key: string, @@ -264,7 +264,7 @@ function overrideBuild, R>( export function LoggedFunction, R>( _target: any, key: string, - descriptor: TypedPropertyDescriptor<(...args: F) => Promise> + descriptor: TypedPropertyDescriptor<(...args: F) => Promise | R> ) { loggerInit(_target); @@ -335,7 +335,7 @@ export function LoggedRoute, R>(route?: string) { return ( _target: any, key: string, - descriptor: TypedPropertyDescriptor<(...args: F) => Promise> + descriptor: TypedPropertyDescriptor<(...args: F) => Promise | R> ) => { loggerInit(_target);