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";
|
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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user