Skip to content

@adrianhall/cloudflare-toolkit


@adrianhall/cloudflare-toolkit / index / statusToSlug

Function: statusToSlug()

statusToSlug(status): string | undefined

Defined in: src/lib/problem-details/status.ts:75

Look up a URL-safe slug for a status code (e.g. 404"not-found"). Useful when building a type URI from a status code.

Parameters

status

number

The HTTP status code.

Returns

string | undefined

The slug, or undefined if the status code is not recognized.