Skip to content

Commit

Permalink
fix: deprecate URL as the first arg of fetch (#14113)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k authored and lucacasonato committed Mar 25, 2022
1 parent 172de68 commit 3953059
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ext/fetch/lib.deno_fetch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,16 @@ declare class Response implements Body {
* ```
*/
declare function fetch(
input: Request | URL | string,
input: Request | string,
init?: RequestInit,
): Promise<Response>;
// TODO(kt3k): Remove the following overloaded declaration for 2.0.
/** @deprecated URL is deprecated as the first argument. Use string or Request object instead.
*
* Fetch a resource from the network. It returns a `Promise` that resolves to the
* `Response` to that `Request`, whether it is successful or not.
*/
declare function fetch(
input: URL,
init?: RequestInit,
): Promise<Response>;

0 comments on commit 3953059

Please sign in to comment.