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

Sorting incorrect when there is a space #16

Closed
0xadri opened this issue Sep 26, 2014 · 2 comments
Closed

Sorting incorrect when there is a space #16

0xadri opened this issue Sep 26, 2014 · 2 comments

Comments

@0xadri
Copy link
Contributor

0xadri commented Sep 26, 2014

var stringAlphanumericalOne = [' ','1','a'];
var stringAlphanumericalTwo = ['img ','img1','imga', 'imgz'];
var stringAlphanumericalThree = ['img 99','img199','imga99', 'imgz99'];

console.log( stringAlphanumericalOne.sort(naturalSort) );
console.log( stringAlphanumericalTwo.sort(naturalSort) );
/* in the call below it fails! order should be ["img 99", "img199", "imga99", "imgz99"] */
console.log( stringAlphanumericalThree.sort(naturalSort) );

see the live demo on http://jsbin.com/hihoqulediyi/1/edit?js,console

@0xadri
Copy link
Contributor Author

0xadri commented Oct 15, 2014

I did some further research regarding this topic, see the result on javve/natural-sort#7

overset pushed a commit that referenced this issue May 4, 2015
@overset
Copy link
Owner

overset commented Sep 9, 2015

fixed with eaee858

@overset overset closed this as completed Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants