Skip to content

Repository files navigation

chubbyts-throwable-to-error

CI Coverage Status Mutation testing badge npm-version

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

Description

It converts any throwable into an Error.

Requirements

  • node: 22

Installation

Through NPM as @chubbyts/chubbyts-throwable-to-error.

npm i @chubbyts/chubbyts-throwable-to-error@^2.3.3

Usage

import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/dist/throwable-to-error';

try {
   throw {key: 'value'};
} catch (e) {
  const error = throwableToError(e);
}

Copyright

2026 Dominik Zogg

About

It converts any throwable into an Error.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages