Skip to content

Commit

Permalink
fix: incorrect type
Browse files Browse the repository at this point in the history
  • Loading branch information
L2jLiga committed Oct 19, 2023
1 parent 73635a1 commit fd61774
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/decorators/helpers/request-decorators.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ export function requestDecoratorsFactory(method: HttpMethods) {
);
};

const option = config.options[hook.name];
if (option == null) config.options[hook.name] = hookFn;
const option = config.options[hook.name as 'onRequest'];
if (option == null) config.options[hook.name as 'onRequest'] = hookFn;
else if (Array.isArray(option)) option.push(hookFn);
else config.options[hook.name] = [option as (...args: unknown[]) => void, hookFn];
else config.options[hook.name as 'onRequest'] = [option as (...args: unknown[]) => void, hookFn];
}
}
if (hasErrorHandlers(target)) {
Expand Down

0 comments on commit fd61774

Please sign in to comment.