@worker-tools/middleware
Version:
A suite of standalone HTTP server middlewares for Worker Runtimes.
14 lines (13 loc) • 448 B
text/typescript
// deno-lint-ignore-file no-explicit-any
class AggregateErrorPolyfill extends Error {
#errors: unknown[];
get name() { return 'AggregateError' }
get errors() { return [...this.#errors] }
constructor(errors: Iterable<unknown>, message = '') {
super(message);
this.#errors = [...errors];
}
}
export const AggregateError: typeof AggregateErrorPolyfill = 'AggregateError' in self
? (<any>self).AggregateError
: AggregateErrorPolyfill