Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): fix typo for unofficial status code type #2894

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/utils/http-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,33 @@ export type ClientErrorStatusCode =
| 431
| 451
export type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511

/**
* `UnOfficalStatusCode` can be used to specify an informal status code.
* `UnofficialStatusCode` can be used to specify an unofficial status code.
* @example
*
* ```ts
* app.get('/', (c) => {
* return c.text("hono is cool", 666 as UnOfficalStatusCode)
* app.get('/unknown', (c) => {
* return c.text("Unknown Error", 520 as UnofficialStatusCode)
* })
* ```
*/
export type UnofficialStatusCode = -1

/**
* @deprecated
* Use `UnofficialStatusCode` instead.
*/
export type UnOfficalStatusCode = -1

/**
* If you want to use an unofficial status, use `UnOfficalStatusCode`.
* If you want to use an unofficial status, use `UnofficialStatusCode`.
*/
export type StatusCode =
| InfoStatusCode
| SuccessStatusCode
| RedirectStatusCode
| ClientErrorStatusCode
| ServerErrorStatusCode
| UnofficialStatusCode
| UnOfficalStatusCode