(token: string)
| 529 | } |
| 530 | |
| 531 | function literalStatus(token: string): number | null { |
| 532 | const t = token.trim(); |
| 533 | if (/^\d{3}$/.test(t)) return Number(t); |
| 534 | const named = /^(?:HttpStatus|HTTPStatus|StatusCodes|HttpStatusCode|http|status|Status|HttpStatusCodes|StatusCode|HTTPResponseStatus)\.(\w+)$/.exec(t) ?? /^\.(\w+)$/.exec(t) ?? /^(?:HTTP_|StatusCodes\.)(\w+)$/.exec(t); |
| 535 | if (named) return statusOfName(named[1]!); |
| 536 | if (/^[A-Z][A-Z_]+$/.test(t)) return statusOfName(t); |
| 537 | return null; |
| 538 | } |
| 539 | |
| 540 | /** The word the legend and a box's sub line use for a category. */ |
| 541 | export function categoryWord(category: string): string { |
no test coverage detected