Skip to content

options parameter reference is mutated by parse #207

Closed
@seansfkelley

Description

@seansfkelley

The reference passed into parse gets mutated, which is unexpected (especially when you, like I, use a file-level constant as the reference).

> options = {}
{}
> qs.parse('', options);
{}
> options
{"delimiter":"&","depth":5,"arrayLimit":20,"parseArrays":true,"allowDots":false,"plainObjects":false,"allowPrototypes":false,"parameterLimit":1000,"strictNullHandling":false}

The same is true of stringify, but to a lesser degree.

Neither parse nor stringify should modify any of their input parameters.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions