Skip to content
Myr

http-status.ts

This file

Path

src/utils/http-status.ts

72 lines · 1.4 KiB · TypeScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than f0b094d point at it.

Merge commit from forkYusuke Wadabefore adoptionf0b094d

lines 1–72why, one step back
1/**
2 * @module3 * HTTP Status utility.4 */56export type InfoStatusCode = 100 | 101 | 102 | 1037export type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 2268export type DeprecatedStatusCode = 305 | 3069export type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 30810export type ClientErrorStatusCode =11 | 40012 | 40113 | 40214 | 40315 | 40416 | 40517 | 40618 | 40719 | 40820 | 40921 | 41022 | 41123 | 41224 | 41325 | 41426 | 41527 | 41628 | 41729 | 41830 | 42131 | 42232 | 42333 | 42434 | 42535 | 42636 | 42837 | 42938 | 43139 | 45140export type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 5114142/**43 * `UnofficialStatusCode` can be used to specify an unofficial status code.44 * @example45 *46 * ```ts47 * app.get('/unknown', (c) => {48 * return c.text("Unknown Error", 520 as UnofficialStatusCode)49 * })50 * ```51 */52export type UnofficialStatusCode = -15354/**55 * @deprecated56 * Use `UnofficialStatusCode` instead.57 */58export type UnOfficalStatusCode = UnofficialStatusCode5960/**61 * If you want to use an unofficial status, use `UnofficialStatusCode`.62 */63export type StatusCode =64 | InfoStatusCode65 | SuccessStatusCode66 | RedirectStatusCode67 | ClientErrorStatusCode68 | ServerErrorStatusCode69 | UnofficialStatusCode7071export type ContentlessStatusCode = 101 | 204 | 205 | 30472export type ContentfulStatusCode = Exclude<StatusCode, ContentlessStatusCode>