@mypolis.eu/error
v0.1.6
Published
[](https://opensource.org/licenses/MIT)
Readme
@mypolis.eu/error
A TypeScript utility library for defining and asserting custom error types,
designed to work seamlessly with @mypolis.eu/result.
Description
@mypolis/error provides a structured way to define specific error types
within your application. It includes a generic Error type and several common
aliases. Crucially, it offers assertion functions (assertNoError and
assertError) for testing purposes, allowing you to test if a value is an
error or not. This is particularly useful when working with the Result type
from @mypolis.eu/result.
Installation
You can install @mypolis.eu/error using pnpm, npm, or yarn:
pnpm add @mypolis.eu/error @mypolis.eu/result
# or
npm install @mypolis.eu/error @mypolis.eu/result
# or
yarn add @mypolis.eu/error @mypolis.eu/result