![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | test/ | 4 days ago | - | |
![]() | README.md | 4 days ago | 2.4K | |
![]() | CHANGELOG.md | 4 days ago | 12K | |
![]() | package.json | 4 days ago | 2.4K | |
![]() | shim.js | 4 days ago | 417 | |
![]() | polyfill.js | 4 days ago | 191 | |
![]() | index.js | 4 days ago | 716 | |
![]() | implementation.js | 4 days ago | 1.7K | |
![]() | auto.js | 4 days ago | 36 | |
![]() | LICENSE | 4 days ago | 1.0K |
ES Proposal spec-compliant shim for AggregateError. Invoke its "shim" method to shim AggregateError
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 AggregateError = require('es-aggregate-error');
var oneError = new RangeError('hi!');
var otherError = new EvalError('oops');
var error = new AggregateError([oneError, otherError], 'this is two kinds of errors');
assert.deepEqual(error.errors, [oneError, otherError]);
assert.equal(error.message, 'this is two kinds of errors');
AggregateError.shim(); // will be a no-op if not needed
assert.ok(new globalThis.AggregateError([]) instanceof AggregateError);
Simply clone the repo, npm install
, and run npm test