We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
got.mergeOptions isn't merging instances of URLSearchParams. According to the README is should merge them.
got.mergeOptions
URLSearchParams
It looks like later instances of URLSearchParams just overwrite earlier values. (see code sample)
It should merge the two URLSearchParams instances.
const got = require('got'); got.mergeOptions({ searchParams: new URLSearchParams({ foo: 1 }) }, { searchParams: new URLSearchParams({ bar: 2 }) }); // => { ... searchParams: URLSearchParams { 'bar' => '2' } }
I think some code got deleted in #921.
merge.ts got moved https://github.com/sindresorhus/got/pull/921/files#diff-5e2f9cb0db248d822e1b167d5ccf8e07. Before the move it had code to deal with instances of URLSearchParams:
merge.ts
got/source/merge.ts
Lines 13 to 21 in 9f4fe33
After the move it's missing the code to handle URLSearchParams: https://github.com/szmarczak/got/blob/a7e73f2fe89b1eca00d2f8fff71dffb2caf68c16/source/utils/merge.ts
The text was updated successfully, but these errors were encountered:
There were no tests for that functionality, so I guess I did remove that innocent piece of code.
I'll fix this on Monday, currently I'm not at home.
Sorry, something went wrong.
szmarczak
Successfully merging a pull request may close this issue.
Describe the bug
got.mergeOptions
isn't merging instances ofURLSearchParams
. According to the README is should merge them.Actual behavior
It looks like later instances of
URLSearchParams
just overwrite earlier values. (see code sample)Expected behavior
It should merge the two URLSearchParams instances.
Code to reproduce
Checklist
I think some code got deleted in #921.
merge.ts
got moved https://github.com/sindresorhus/got/pull/921/files#diff-5e2f9cb0db248d822e1b167d5ccf8e07. Before the move it had code to deal with instances ofURLSearchParams
:got/source/merge.ts
Lines 13 to 21 in 9f4fe33
After the move it's missing the code to handle
URLSearchParams
: https://github.com/szmarczak/got/blob/a7e73f2fe89b1eca00d2f8fff71dffb2caf68c16/source/utils/merge.tsThe text was updated successfully, but these errors were encountered: