This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
replaceQueryInUrl
update function parameter should be ParsedUrlQuery
, not ParsedUrlQueryInput
#12
Labels
bug
Something isn't working
When
replaceQueryInUrl
is called with an update function, we first parse the URL and then pass the parsed URL's query into the update function.This type of this query will always be
ParsedUrlQuery
, neverParsedUrlQueryInput
(which is wider as it includesboolean
/number
as well asstring
).ParsedUrlQueryInput
should only be used for the update function's return type. This is for convenience, so that the user may rely on coercion of query parameters with a type ofboolean
/number
.The reason I had to make
replaceQueryInUrl
receive the wider typeParsedUrlQueryInput
is because it is implemented using the parsed URL variant of this function—replaceQueryInParsedUrl
—and this variant must use the same type in the parameter/return type positions so that it can be chained with other functions (example).https://crewlabs.slack.com/archives/C0STWEZ2B/p1606837844221800
Note this issue would be made redundant by the fix for #15, since those new APIs don't have separate input/output types.
The text was updated successfully, but these errors were encountered: