Socket
Socket
Sign inDemoInstall

suppressed-error

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suppressed-error

ES Proposal spec-compliant shim for SuppressedError


Version published
Weekly downloads
13K
decreased by-3.78%
Maintainers
1
Weekly downloads
 
Created
Source

suppressed-error Version Badge

github actions coverage License Downloads

npm badge

ES Proposal spec-compliant shim for SuppressedError. Invoke its "shim" method to shim SuppressedError if it is unavailable or noncompliant.

This package implements the es-shim API interface. It works in an ES3-supported environment, and complies with the proposed spec.

Most common usage:

var assert = require('assert');
var SuppressedError = require('suppressed-error');

var suppressedError = new RangeError('hi!');
var cause = new EvalError('oops');
var error = new SuppressedError(cause, suppressedError, 'this is a suppressed error');

assert.equal(error.error, cause); // this is the cause of the suppression
assert.equal(error.suppressed, suppressedError);
assert.equal(error.message, 'this is a suppressed error');

SuppressedError.shim(); // will be a no-op if not needed

assert.ok(new globalThis.SuppressedError(null, '', {}) instanceof SuppressedError);

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Package last updated on 05 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc