Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #167
Closes #182
Closes #187
This PR:
options
object passed to hooks so that all Ky and fetch options are included. For context: in Ky v0.15.0 and earlier, a subset of Ky options were included in theoptions
object (e.g.prefixUrl
was included, butthrowHttpErrors
was not, without any clear justification).json
option now takes precedence overbody
, rather than being mutually exclusive withbody
. Additionally,searchParams
can now be any value supported byURLSearchParams()
, which makes it possible to use a boolean as a param value, provide the params as an array of entries, etc.document
object, which was previously used in some circumstances to determine the base URL of the page, from which we resolve relative URLs. TheRequest
class is now used to achieve the same goal.Request
is significantly easier to polyfill and is much more likely to be available in web workers and non-browser environments.Set
s throughout the API for simplicity. This should not have any meaningful performance impacts, since the lists of HTTP methods and status codes are inherently small in size, even if you were to include all valid methods and status codes. See Pass all Ky options to hooks #188 (comment).