The Wayback Machine - https://web.archive.org/web/20210123215142/https://github.com/sindresorhus/query-string/pull/163
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

Fix sort example for `stringify` method #163

Merged
merged 1 commit into from Jan 19, 2019
Merged

Conversation

@nickglazer
Copy link
Contributor

@nickglazer nickglazer commented Jan 19, 2019

Since the sort option of stringify eventually gets passed to Array.sort it needs to return a Number, not a Boolean. So by subtracting the indexes of the keys rather than comparing them, the keys will be sorted properly.

nglazerdev
Since the sort option of stringify eventually gets passed to Array.sort it needs to return a Number, not a Boolean. So by subtracting the indexes of the keys rather than comparing them, the keys will be sorted properly.
@kevva kevva changed the title fixed example of stringify sort Fix sort example for `stringify` method Jan 19, 2019
@kevva kevva merged commit e232cb3 into sindresorhus:master Jan 19, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kevva
Copy link
Contributor

@kevva kevva commented Jan 19, 2019

Thanks @nglazerdev :)

@nickglazer nickglazer deleted the nickglazer:patch-1 branch Jan 19, 2019
@nickglazer nickglazer restored the nickglazer:patch-1 branch Jan 19, 2019
@nickglazer nickglazer deleted the nickglazer:patch-1 branch Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.