mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[node-fetch] Fix interable members (were wrongly typed to Iterator) (#44147)
* [node-fetch] Switch to strict mode, drop unnecessary ES5 lib * [node-fetch] Fix interable members (were wrongly typed to `Iterator`)
This commit is contained in:
parent
cd367bc61a
commit
839738b973
8
types/node-fetch/index.d.ts
vendored
8
types/node-fetch/index.d.ts
vendored
@ -117,10 +117,10 @@ export class Headers implements Iterable<[string, string]> {
|
||||
raw(): { [k: string]: string[] };
|
||||
set(name: string, value: string): void;
|
||||
|
||||
// Iterator methods
|
||||
entries(): Iterator<[string, string]>;
|
||||
keys(): Iterator<string>;
|
||||
values(): Iterator<[string]>;
|
||||
// Iterable methods
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
keys(): IterableIterator<string>;
|
||||
values(): IterableIterator<[string]>;
|
||||
[Symbol.iterator](): Iterator<[string, string]>;
|
||||
}
|
||||
|
||||
|
||||
@ -159,10 +159,15 @@ function handlePromise(
|
||||
});
|
||||
}
|
||||
|
||||
function test_headersRaw() {
|
||||
function test_headers() {
|
||||
const headers = new Headers();
|
||||
const myHeader = "foo";
|
||||
headers.raw()[myHeader]; // $ExpectType string[]
|
||||
|
||||
[...headers]; // $ExpectType [string, string][]
|
||||
[...headers.entries()]; // $ExpectType [string, string][]
|
||||
[...headers.keys()]; // $ExpectType string[]
|
||||
[...headers.values()]; // $ExpectType [string][]
|
||||
}
|
||||
|
||||
function test_isRedirect() {
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "ES6",
|
||||
"lib": [
|
||||
"es5",
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strict": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user