Skip to content

Default options are ignored when type is object #209

Open
@mickaelchanrion

Description

@mickaelchanrion

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions