Ability to specify locale options for strings
LinusU opened this issue · 1 comments
LinusU commented
We have a lot of arrays that we are sorting before presenting to a user. Since it's a Swedish app we are using the following code:
lhs.localeCompare(rhs, 'sv-SE', { numeric: true, sensitivity: 'accent' })
It would be great if there was a way to pass these options into the localeCompare
call inside sort-on
.
If you have any input on how the api would look I'd be happy to submit a PR 🚀
sindresorhus commented
Maybe a locales
and localeOptions
options where the latter is just passing through http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options ?
Alternatively, move locales
into the the localeOptions
, but that may make it harder to document and type.