import * as fathymAtomicIcons from "https://deno.land/x/fathym_atomic_icons@v0.0.30/src/src.deps.ts";
Contains the STATUS_CODE
object which contains standard HTTP
status codes and provides several type guards for handling status codes
with type safety.
Examples
Example 1
Example 1
import {
STATUS_CODE,
STATUS_TEXT,
} from "https://deno.land/std@0.224.0/http/status.ts";
console.log(STATUS_CODE.NotFound); // Returns 404
console.log(STATUS_TEXT[STATUS_CODE.NotFound]); // Returns "Not Found"
Example 2
Example 2
import { isErrorStatus } from "https://deno.land/std@0.224.0/http/status.ts";
const res = await fetch("https://example.com/");
if (isErrorStatus(res.status)) {
// error handling here...
}
Namespaces
N path | Utilities for working with OS-specific file paths. |
Variables
Contains the | |
A record of all the status codes text. |
Functions
A type guard that determines if the status code is a client error. | |
A type guard that determines if the status code is an error. | |
A type guard that determines if the status code is informational. | |
A type guard that determines if the status code is a redirection. | |
A type guard that determines if the status code is a server error. | |
Returns whether the provided number is a valid HTTP status code. | |
A type guard that determines if the status code is successful. | |
Return the last portion of a | |
Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator. | |
Return the directory path of a | |
Return the extension of the | |
Generate a path from | |
Converts a file URL to a path string. | |
Convert a glob string to a regular expression. | |
Verifies whether provided path is absolute | |
Test whether the given string is a glob | |
Join all given a sequence of | |
Like join(), but doesn't collapse "**/.." when | |
Normalize the | |
Like normalize(), but doesn't collapse "**/.." when | |
Return a | |
Return the relative path from | |
Resolves path segments into a | |
Converts a path string to a file URL. | |
Resolves path to a namespace path | |
Interfaces
Options for | |
A parsed path object generated by path.parse() or consumed by path.format(). |
Type Aliases
An HTTP status that is a client error (4XX). | |
An HTTP status that is an error (4XX and 5XX). | |
An HTTP status that is a informational (1XX). | |
An HTTP status that is a redirect (3XX). | |
An HTTP status that is a server error (5XX). | |
An HTTP status code. | |
An HTTP status text. | |
An HTTP status that is a success (2XX). |