UNPKG

448 BPlain TextView Raw
1// deno-lint-ignore-file no-explicit-any
2class AggregateErrorPolyfill extends Error {
3 #errors: unknown[];
4 get name() { return 'AggregateError' }
5 get errors() { return [...this.#errors] }
6 constructor(errors: Iterable<unknown>, message = '') {
7 super(message);
8 this.#errors = [...errors];
9 }
10}
11
12export const AggregateError: typeof AggregateErrorPolyfill = 'AggregateError' in self
13 ? (<any>self).AggregateError
14 : AggregateErrorPolyfill
\No newline at end of file