Status is

GitHub

Predicates for identifying successful and authentication-required HTTP responses.

Installation

bash
pnpm dlx shadcn@latest add @cs/status-is

Usage

tsx
import { statusIsSuccess } from "@/lib/cs/status-is"
tsx
statusIsSuccess(200)

API Reference

statusIsSuccess

Returns whether an HTTP status code represents a successful response.

Parameters

NameTypeDefaultDescription
status *HttpStatus--

Returns: boolean

statusIsLogin

Returns whether an HTTP status code requires authentication.

Parameters

NameTypeDefaultDescription
status *HttpStatus--

Returns: boolean

Dependencies