isSuccessfulStatus

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

function

function isSuccessfulStatus(status: number): status is SuccessfulStatus

A type guard that determines if the status code is successful.

status: number

The status to assert against.

Returns

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

Example: Usage

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

assert(isSuccessfulStatus(200));

Source