Skip to content

Default options are ignored when type is object #209

@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions