Function isClientErrorStatus

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

    Parameters

    • status: number

      The status to assert against.

    Returns status is ClientErrorStatus

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

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

    assert(isClientErrorStatus(404));