Use caps for http method types

This commit is contained in:
Michael Wolf
2025-03-07 20:25:13 -06:00
parent 8d494cdf3b
commit d1d4e03885

View File

@@ -8,17 +8,17 @@ import { HttpCode, httpCodes } from "./http-codes.ts";
import { ContentType, contentTypes } from "./content-types.ts"; import { ContentType, contentTypes } from "./content-types.ts";
const methodParser = z.union([ const methodParser = z.union([
z.literal("get"), z.literal("GET"),
z.literal("post"), z.literal("POST"),
z.literal("put"), z.literal("PUT"),
z.literal("patch"), z.literal("PATCH"),
z.literal("delete"), z.literal("DELETE"),
]); ]);
export type Method = z.infer<typeof methodParser>; export type Method = z.infer<typeof methodParser>;
const massageMethod = (input: string): Method => { const massageMethod = (input: string): Method => {
const r = methodParser.parse(input.toLowerCase()) const r = methodParser.parse(input.toUpperCase())
return r; return r;
}; };