MCPcopy Create free account
hub / github.com/Effect-TS/effect / toStatus

Function toStatus

packages/tools/openapi-generator/src/HttpApiTransformer.ts:518–523  ·  view source on GitHub ↗
(status: string)

Source from the content-addressed store, hash-verified

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

Callers 1

renderResponseSetFunction · 0.85

Calls 1

NumberInterface · 0.50

Tested by

no test coverage detected