Function isServerErrorStatus

  • A type guard that determines if the status code is a server error.

    Parameters

    • status: number

      The status to assert against.

    Returns status is ServerErrorStatus

    Whether or not the provided status is a server error status code.

    import { isServerErrorStatus } from "@std/http/status";
    import { assert } from "@std/assert";

    assert(isServerErrorStatus(502));