Skip to content

Commit cb2b0a2

Browse files
committed
Update polyfill comments to reflect secret support.
1 parent 145dc4d commit cb2b0a2

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/communication/NetworkClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import breakUrl from './breakUrl';
1616
import buildUrl, { type SearchParameters } from './buildUrl';
1717
import dromedaryCase from './dromedaryCase';
1818
import { idempotencyHeaderName, ResponseWithIdempotencyKey, retryingFetch } from './makeRetrying';
19-
import { URL } from 'url'; // This isn't necessary for newer node versions, but it allows us to secretly support node 8. Should we ever drop that completely and move to 10+, we can remove this import.
19+
// The following line is only necessary for Node.js < 10.0.0, which we only secretly support. Should we ever drop that support completely, we can remove this import.
20+
import { URL } from 'url';
2021

2122
/**
2223
* Like `[].map` but with support for non-array inputs, in which case this function behaves as if an array was passed

src/communication/breakUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// If support for Node.js < 10.0.0 is ever dropped, this import can be removed.
1+
// The following line is only necessary for Node.js < 10.0.0, which we only secretly support. Should we ever drop that support completely, we can remove this import.
22
import { URL } from 'url';
33

44
import buildFromEntries from '../plumbing/buildFromEntries';

src/communication/buildUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// If support for Node.js < 10.0.0 is ever dropped, this import can be removed.
1+
// The following line is only necessary for Node.js < 10.0.0, which we only secretly support. Should we ever drop that support completely, we can remove this import.
22
import { URLSearchParams } from 'url';
33

44
import { apply, runIf } from 'ruply';

src/plumbing/buildFromEntries.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* Returns an object generated from the passed a list of key-value pairs.
33
*
4-
* If support for Node.js < 12.0.0 is ever dropped, this function can be removed in favour of `Object.fromEntries`.
4+
* This function only exists to support Node.js < 12.0.0, which we only secretly support. Should we ever drop that
5+
* support completely, this function can be removed in favour of `Object.fromEntries`.
56
*/
67
export default ((): (<T>(input: Iterable<readonly [string, T]>) => Record<string, T>) => {
78
if (Object.fromEntries != undefined) {

src/plumbing/iteration/HelpfulIterator.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ export default class HelpfulIterator<T> implements AsyncIterator<T, void, never>
6666
this.next = wrappee.next.bind(wrappee);
6767
}
6868

69-
// Node.js < 10.0.0 does not support Symbol.asyncIterator. Symbol.asyncIterator therefore resolves to undefined,
70-
// which actually creates a method called "undefined" callable as iterator.undefined(). Albeit odd, I don't feel this
71-
// warrants a "fix", especially as it only affects old Node.js versions.
7269
[Symbol.asyncIterator]() {
7370
return this;
7471
}

0 commit comments

Comments
 (0)