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

Not lexigraphical sort #7

Open
coolaj86 opened this issue Jan 1, 2022 · 2 comments
Open

Not lexigraphical sort #7

coolaj86 opened this issue Jan 1, 2022 · 2 comments

Comments

@coolaj86
Copy link

coolaj86 commented Jan 1, 2022

Lex sort is 0-9, A-Z, a-z (by ASCII char code)

'0'.charCodeAt(0)
// 48
'A'.charCodeAt(0)
// 65
'a'.charCodeAt(0)
// 97

Example:

'yH2UOqtaQrbcoJBEZKM0jRzGPId6vkAnF8g1STp3NiW5wsDfV7lYx4emX9LCuh'.split('').sort().join('');
// '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'

The same is true for SQL.

@tjmehta
Copy link
Owner

tjmehta commented Jan 1, 2022

gotcha, I guess this module sorts lower and upper differently. per docs A < Z < a < z < 0 < 9

@tjmehta
Copy link
Owner

tjmehta commented Jan 1, 2022

feel free to update the charMap and can publish a new major version if you'd like

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