Skip to content

Commit

Permalink
chore: avoid triple-slash reference directive (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson authored Nov 10, 2024
1 parent 309441c commit 1db135b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
15 changes: 13 additions & 2 deletions src/async/AggregateError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
/// <reference lib="es2021.promise" />
interface AggregateError extends Error {
errors: any[]
}

interface AggregateErrorConstructor {
new (errors: Iterable<any>, message?: string): AggregateError
(errors: Iterable<any>, message?: string): AggregateError
readonly prototype: AggregateError
}

declare const globalThis: {
AggregateError?: AggregateErrorConstructor
}

/**
* The `AggregateError` object represents an error when several errors
Expand All @@ -13,7 +25,6 @@
*/
const AggregateErrorOrPolyfill: AggregateErrorConstructor =
/* @__PURE__ */ (() =>
// eslint-disable-next-line compat/compat
globalThis.AggregateError ??
(class AggregateError extends Error {
errors: Error[]
Expand Down
1 change: 0 additions & 1 deletion tests/async/all.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as _ from 'radashi'
import type { AggregateError } from 'radashi'

describe('all', () => {
const promise = {
Expand Down
1 change: 0 additions & 1 deletion tests/async/parallel.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as _ from 'radashi'
import type { AggregateError } from 'radashi'

describe('parallel', () => {
test('returns all results from all functions', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"moduleResolution": "node",
"outDir": "../dist/tmp",
"target": "esnext",
"lib": ["es2020"],
"lib": ["es2020", "es2021.promise"],
"esModuleInterop": true,
"module": "esnext",
"skipLibCheck": true,
Expand Down

0 comments on commit 1db135b

Please sign in to comment.