Skip to main content
This package has been archived, and as such it is read-only.

latest

[⛔ Deprecated] Wrapper classes for indeterminate data

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
35%
Published
4 weeks ago (9.1.1)
Warning

This package is deprecated.

wrap

Wrapper classes for indeterminate data: Box and Result. Mutual properties exist for the possible states of a wrapper that help you determine that state and if content properties are valid to read from.

Importing

The default entrypoint exports all wrapper modules.

import { Box, Result } from "@deleteables/wrap"

If multiple entrypoints are supported, you can import a specific wrapper.

import { Box } from "@deleteables/wrap/box"
import { Result } from "@deleteables/wrap/result"

Usage

Boxes

Construct a box without arguments for an empty box. Construct a box with an argument for a full box that contains that argument. Consumers can directly access full and data with their own discretion or use class methods to interface with a box.

Results

Construct a result with the first argument being true for a success result. Construct a result with the first argument being false for a failure result. The second argument in these constructors are placed in the data property for success results or the reason property for failure results. Consumers can directly access ok and either data or reason with their own discretion or use class methods to interface with a result.

License

All files under this package are licensed as shown in the LICENSE file.

Add Package

deno add jsr:@deleteables/wrap

Import symbol

import * as wrap from "@deleteables/wrap";

---- OR ----

Import directly with a jsr specifier

import * as wrap from "jsr:@deleteables/wrap";

Add Package

npx jsr add @deleteables/wrap

Import symbol

import * as wrap from "@deleteables/wrap";

Add Package

yarn dlx jsr add @deleteables/wrap

Import symbol

import * as wrap from "@deleteables/wrap";

Add Package

pnpm dlx jsr add @deleteables/wrap

Import symbol

import * as wrap from "@deleteables/wrap";

Add Package

bunx jsr add @deleteables/wrap

Import symbol

import * as wrap from "@deleteables/wrap";