Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

View File

@@ -0,0 +1,31 @@
# @isaacs/string-locale-compare
Compare strings with Intl.Collator if available, falling back to
String.localeCompare otherwise.
This also forces the use of a specific locale, to avoid using the system
locale, which is non-deterministic.
## USAGE
```js
const stringLocaleCompare = require('@isaacs/string-locale-compare')
myArrayOfStrings.sort(stringLocaleCompare('en'))
// can also pass extra options
myArrayOfNumericStrings.sort(stringLocaleCompare('en', { numeric: true }))
```
## API
`stringLocaleCompare(locale, [options])`
Locale is required, must be a valid locale string.
Options is optional. The following options are supported:
* `sensitivity`
* `numeric`
* `ignorePunctuation`
* `caseFirst`