Skip to content

Commit

Permalink
Expressing Method via IRouter.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail committed May 6, 2024
1 parent cc3fff8 commit 232f579
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/method.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
export type Method = "get" | "post" | "put" | "delete" | "patch";
export const methods: Method[] = ["get", "post", "put", "delete", "patch"];
export type AuxMethod = "options";
import type { IRouter } from "express";

export const methods = [
"get",
"post",
"put",
"delete",
"patch",
] satisfies Array<keyof IRouter>;

export type Method = (typeof methods)[number];

export type AuxMethod = Extract<keyof IRouter, "options">;

0 comments on commit 232f579

Please sign in to comment.