(status: string)
| 516 | const toHttpApiPath = (path: string): string => path.replace(/{([^}]+)}/g, ":$1") |
| 517 | |
| 518 | const toStatus = (status: string): number | undefined => { |
| 519 | if (!/^\d{3}$/.test(status)) { |
| 520 | return |
| 521 | } |
| 522 | return Number(status) |
| 523 | } |
| 524 | |
| 525 | const applyStatus = (schema: string, status: number, target: "success" | "error"): string => { |
| 526 | if ((target === "success" && status === 200) || (target === "error" && status === 500)) { |
no test coverage detected