isStatus

import { isStatus } from "jsr:@ende/http";

function

function isStatus(status: number): status is StatusCode

Returns whether the provided number is a valid HTTP status code.

status: number

The status to assert against.

Returns

Whether or not the provided status is a valid status code.

Example: Usage

import { isStatus } from "@ende/http/status";
import { assert } from "@ende/assert";

assert(isStatus(404));

Source