@worker-tools/router
Version:
A router for Worker Runtimes such as Cloudflare Workers and Service Workers.
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