Skip to content

Commit

Permalink
fix(types): fix typo for unofficial status code type (#2894)
Browse files Browse the repository at this point in the history
* fix(types): fix typo for UnofficialStatusCode

* change pathname

* unify the descriptions
  • Loading branch information
ryuapp authored Jun 3, 2024
1 parent 5c348b2 commit a036d70
Showing 1 changed file with 12 additions and 4 deletions.
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

0 comments on commit a036d70

Please sign in to comment.