Skip to content

Commit

Permalink
feat(hono): add async to handler
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed May 13, 2024
1 parent 393a6d8 commit db7de2f
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions packages/hono/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ ${
!!verbOption.response.originalSchema?.['200']?.content?.['application/json']
? `zValidator('response', ${verbOption.operationName}Response),\n`
: ''
}(c: ${contextTypeName}) => {
}async (c: ${contextTypeName}) => {
},
);`;
Expand Down Expand Up @@ -199,17 +199,14 @@ const getHandlerFix = ({
const getVerbOptionGroupByTag = (
verbOptions: Record<string, GeneratorVerbOptions>,
) => {
return Object.values(verbOptions).reduce(
(acc, value) => {
const tag = value.tags[0];
if (!acc[tag]) {
acc[tag] = [];
}
acc[tag].push(value);
return acc;
},
{} as Record<string, GeneratorVerbOptions[]>,
);
return Object.values(verbOptions).reduce((acc, value) => {
const tag = value.tags[0];
if (!acc[tag]) {
acc[tag] = [];
}
acc[tag].push(value);
return acc;
}, {} as Record<string, GeneratorVerbOptions[]>);
};

const generateHandlers = async (
Expand Down

0 comments on commit db7de2f

Please sign in to comment.