Skip to content

Instantly share code, notes, and snippets.

@munierujp
Last active September 16, 2022 04:56
Show Gist options
  • Save munierujp/69375cade713d0cf74ebb2471ed09557 to your computer and use it in GitHub Desktop.
Save munierujp/69375cade713d0cf74ebb2471ed09557 to your computer and use it in GitHub Desktop.
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