Use caps for http method types
This commit is contained in:
@@ -8,17 +8,17 @@ import { HttpCode, httpCodes } from "./http-codes.ts";
|
||||
import { ContentType, contentTypes } from "./content-types.ts";
|
||||
|
||||
const methodParser = z.union([
|
||||
z.literal("get"),
|
||||
z.literal("post"),
|
||||
z.literal("put"),
|
||||
z.literal("patch"),
|
||||
z.literal("delete"),
|
||||
z.literal("GET"),
|
||||
z.literal("POST"),
|
||||
z.literal("PUT"),
|
||||
z.literal("PATCH"),
|
||||
z.literal("DELETE"),
|
||||
]);
|
||||
|
||||
export type Method = z.infer<typeof methodParser>;
|
||||
|
||||
const massageMethod = (input: string): Method => {
|
||||
const r = methodParser.parse(input.toLowerCase())
|
||||
const r = methodParser.parse(input.toUpperCase())
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user