I don't know if this is intentional, but the README - and the TypeScript definitions - state that in ky(input, options) ky accepts the same values as fetch.
However, passing a Request instance as the value for input does not work, since it's stringified here and it turns into [object Request].
Yep, confirmed, this is a bug introduced by PR #11. Thanks for reporting it!
The reason we stringify the input is to support passing in a WHATWG URL instance. Those objects stringify to the appropriate URL, whereas Request objects do not.
The solution will involve checking this._input instanceof Request, and if true, use the value of this._input.url during construction of the prefix URL.
Most helpful comment
Yep, confirmed, this is a bug introduced by PR #11. Thanks for reporting it!
The reason we stringify the input is to support passing in a WHATWG URL instance. Those objects stringify to the appropriate URL, whereas
Requestobjects do not.The solution will involve checking
this._input instanceof Request, and if true, use the value ofthis._input.urlduring construction of the prefix URL.