diff --git a/types/node-fetch/index.d.ts b/types/node-fetch/index.d.ts index c28dd403d4..c5b5c707a3 100644 --- a/types/node-fetch/index.d.ts +++ b/types/node-fetch/index.d.ts @@ -6,6 +6,7 @@ // Antonio Román // Andrew Leedham // Jason Li +// Brandon Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -179,7 +180,7 @@ export interface ResponseInit { status?: number; statusText?: string; timeout?: number; - url: string; + url?: string; } export type HeadersInit = Headers | string[][] | { [key: string]: string }; @@ -194,7 +195,7 @@ export type BodyInit = export type RequestInfo = string | Request; declare function fetch( - url: string | Request, + url: RequestInfo, init?: RequestInit ): Promise; diff --git a/types/node-fetch/node-fetch-tests.ts b/types/node-fetch/node-fetch-tests.ts index 93a8ac89f1..9dfb3179e4 100644 --- a/types/node-fetch/node-fetch-tests.ts +++ b/types/node-fetch/node-fetch-tests.ts @@ -117,9 +117,7 @@ function test_Blob() { function test_ResponseInit() { fetch("http://test.com", {}).then(response => { - new Response(response.body, { - url: response.url, - }); + new Response(response.body); new Response(response.body, { url: response.url, size: response.size,