isErrorStatus

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

function

function isErrorStatus(status: number): status is ErrorStatus

A type guard that determines if the status code is an error.

status: number

The status to assert against.

Returns

Whether or not the provided status is an error status code.

Example: Usage

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

assert(isErrorStatus(502));

Source