es-aggregate-error

ES Proposal spec-compliant shim for AggregateError

MIT 15 个版本
安装
npm install es-aggregate-error
yarn add es-aggregate-error
pnpm add es-aggregate-error
bun add es-aggregate-error
README

es-aggregate-error Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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);

Tests

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

版本列表
1.0.14 2025-06-02
1.0.13 2024-03-22
1.0.12 2024-02-05
1.0.11 2023-09-13
1.0.10 2023-08-27
1.0.9 2022-11-02
1.0.8 2022-05-05
1.0.7 2021-10-01
1.0.6 2021-10-01
1.0.5 2020-11-23
1.0.4 2020-08-09
1.0.3 2020-06-04
1.0.2 2019-12-14
1.0.1 2019-11-11
1.0.0 2019-10-21