Created
October 9, 2025 09:37
-
-
Save orrisroot/1015ef6b0ddadac2d2ec1f2acb43f7b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const naturalCompare = (a: string, b: string): number => { | |
| const locales = new Set<string>([...navigator.languages, 'en-US', 'ja-JP']); | |
| return new Intl.Collator(Array.from(locales), { | |
| sensitivity: 'variant', | |
| numeric: true, | |
| }).compare(a, b); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment