Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 4331ea8

Browse files
committed
Declare SymbolConstructor for older versions of ES
Older versions of the ES standard do not define `Symbol#asyncIterator`. This means our attempts to "manually" define `AsyncIterator` for versions of ES that don't have it fail. Following [1] and [2], our understanding is that the best existing solution is to manually re-define `SymbolConstructor` to have this member. [1]: microsoft/TypeScript#13031 [2]: microsoft/TypeScript#8099
1 parent 58c4156 commit 4331ea8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nodejs/query/interfaces.ts

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222

2323
///////////////////////////////////////////////////////////////////////////////
2424

25+
declare global {
26+
export interface SymbolConstructor {
27+
readonly asyncIterator: symbol;
28+
}
29+
}
30+
2531
export interface AsyncIterator<T> {
2632
next(value?: any): Promise<IteratorResult<T>>;
2733
return?(value?: any): Promise<IteratorResult<T>>;

0 commit comments

Comments
 (0)