Download .opencode/node_modules/effect/src/unstable/http/HttpMethod.ts from Chenloong999/opencode-data: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/84c8581d284a6a73a22921151ea3d89e2bcfe44e/.opencode/node_modules/effect/src/unstable/http/HttpMethod.ts
- Command line
-
hf download hf://datasets/Chenloong999/opencode-data@84c8581d284a6a73a22921151ea3d89e2bcfe44e/.opencode/node_modules/effect/src/unstable/http/HttpMethod.ts
-
curl -L -o HttpMethod.ts https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/84c8581d284a6a73a22921151ea3d89e2bcfe44e/.opencode/node_modules/effect/src/unstable/http/HttpMethod.ts
1.52 kB
| /** | |
| * @since 4.0.0 | |
| */ | |
| /** | |
| * @since 4.0.0 | |
| * @category models | |
| */ | |
| export type HttpMethod = | |
| | "GET" | |
| | "POST" | |
| | "PUT" | |
| | "DELETE" | |
| | "PATCH" | |
| | "HEAD" | |
| | "OPTIONS" | |
| | "TRACE" | |
| /** | |
| * @since 4.0.0 | |
| * @category models | |
| */ | |
| export declare namespace HttpMethod { | |
| /** | |
| * @since 4.0.0 | |
| * @category models | |
| */ | |
| export type NoBody = "GET" | "HEAD" | "OPTIONS" | "TRACE" | |
| /** | |
| * @since 4.0.0 | |
| * @category models | |
| */ | |
| export type WithBody = Exclude<HttpMethod, NoBody> | |
| } | |
| /** | |
| * @since 4.0.0 | |
| */ | |
| export const hasBody = (method: HttpMethod): method is HttpMethod.WithBody => | |
| method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" | |
| /** | |
| * @since 4.0.0 | |
| */ | |
| export const all: ReadonlySet<HttpMethod> = new Set([ | |
| "GET", | |
| "POST", | |
| "PUT", | |
| "DELETE", | |
| "PATCH", | |
| "HEAD", | |
| "OPTIONS", | |
| "TRACE" | |
| ]) | |
| /** | |
| * @since 4.0.0 | |
| */ | |
| export const allShort = [ | |
| ["GET", "get"], | |
| ["POST", "post"], | |
| ["PUT", "put"], | |
| ["DELETE", "del"], | |
| ["PATCH", "patch"], | |
| ["HEAD", "head"], | |
| ["OPTIONS", "options"], | |
| ["TRACE", "trace"] | |
| ] as const | |
| /** | |
| * Tests if a value is a `HttpMethod`. | |
| * | |
| * **Example** | |
| * | |
| * ```ts | |
| * import { HttpMethod } from "effect/unstable/http" | |
| * | |
| * console.log(HttpMethod.isHttpMethod("GET")) | |
| * // true | |
| * console.log(HttpMethod.isHttpMethod("get")) | |
| * // false | |
| * console.log(HttpMethod.isHttpMethod(1)) | |
| * // false | |
| * ``` | |
| * | |
| * @since 4.0.0 | |
| * @category refinements | |
| */ | |
| export const isHttpMethod = (u: unknown): u is HttpMethod => all.has(u as HttpMethod) | |