Skip to content

Add option to sort object keys #64

@zaim

Description

@zaim

Consider adding an option to sort object keys. This could be useful when using query strings for (or as part of) a unique key, ensuring the order of property declaration doesn't affect output.

qs.stringify({ a: 'b', z: 'x' }) === 'a=b&z=x';
qs.stringify({ z: 'x', a: 'b' }) === 'z=x&a=b';
qs.stringify({ z: 'x', a: 'b' }, { sort: true }) === 'a=b&z=x';

I can work on this and provide pull request if okay.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions