JSPM

suppressed-error

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16573
  • Score
    100M100P100Q136587F
  • License MIT

ES Proposal spec-compliant shim for SuppressedError

Package Exports

  • suppressed-error
  • suppressed-error/auto
  • suppressed-error/auto.js
  • suppressed-error/index.js
  • suppressed-error/polyfill
  • suppressed-error/polyfill.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (suppressed-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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