Skip to content
New issue

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

Default options are ignored when type is object #209

Open
mickaelchanrion opened this issue Jun 28, 2022 · 0 comments
Open

Default options are ignored when type is object #209

mickaelchanrion opened this issue Jun 28, 2022 · 0 comments

Comments

@mickaelchanrion
Copy link

mickaelchanrion commented Jun 28, 2022

When an option is an object (e.i.: headers, queryParams), the defaults are always overridden if defined again.

Ex:
Screenshot 2022-06-28 at 19 24 13

I think the culprit is located here:

const _options = { ...this._defaults, ...options }

After updating ky + replace this line by:

const _options = defu(options, this._defaults)

everything is back in order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant