workers-types icon indicating copy to clipboard operation
workers-types copied to clipboard

The `fetch()` request parameter's type is not correct

Open dario-piotrowicz opened this issue 3 years ago • 0 comments

The fetch() request's type is set as Request | string as you can see here: https://github.com/cloudflare/workers-types/blob/4d2664ba55a5c4cc6eaa3d4a144de3156ba6ebda/index.d.ts#L1936

But a URL object should also be accepted (as you can see from this issue #1588 and the PR I opened to resolve it)

And in general the MDN fetch docs say that the parameter could generally be any object with a "stringifier"

dario-piotrowicz avatar Sep 06 '22 08:09 dario-piotrowicz