Last active
September 16, 2022 04:56
-
-
Save munierujp/69375cade713d0cf74ebb2471ed09557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const HttpMethod = { | |
Get: 'GET', | |
Head: 'HEAD', | |
Post: 'POST', | |
Put: 'PUT', | |
Delete: 'DELETE', | |
Connect: 'CONNECT', | |
Options: 'OPTIONS', | |
Trace: 'TRACE', | |
Patch: 'PATCH' | |
} as const | |
export type HttpMethod = typeof HttpMethod[keyof typeof HttpMethod] | |
const values = Object.values(HttpMethod) | |
export const isHttpMethod = (value: any): value is HttpMethod => values.includes(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment