Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

sortObjectKeys={true} can't be used on firefox #83

Closed
iascchen opened this issue Jun 3, 2017 · 3 comments
Closed

sortObjectKeys={true} can't be used on firefox #83

iascchen opened this issue Jun 3, 2017 · 3 comments

Comments

@iascchen
Copy link

iascchen commented Jun 3, 2017

sortObjectKeys={true} can't be used on firefox, firefox version is 53.0.3 (64 bit) of OSX.
It is working on chrome.

@jayphelps
Copy link

It doesn't work for me either, even in Chrome.

Taking a look at the source, I can't find any place that the boolean variant would be correctly handled. Perhaps the docs are just out of date and it only supports the function now? If the maintainers confirm, I'm happy to update them.

if (typeof sortObjectKeys !== 'undefined') {
keys.sort(sortObjectKeys);
}

@retrofox
Copy link

retrofox commented Jan 3, 2018

Perhaps the docs are just out of date and it only supports the function now?

That seems to be true. Getting the same issue here.

arr.sort([compareFunction])
Parameters
compareFunction: Optional

Specifies a function that defines the sort order. If omitted, the array is sorted according to each character's Unicode code point value, according to the string conversion of each element.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

@nhunzaker
Copy link
Contributor

I just hit this too. I'll send out a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants