@@ -1174,22 +1174,32 @@ String.padEnd("abc", 1, "") == "abc"
11741174external padEnd : (string , int , string ) => string = "padEnd"
11751175
11761176/**
1177- `localeCompare(referenceStr, compareStr)` returns a float than indicatings
1177+ `localeCompare(referenceStr, compareStr, ~locales=?, ~options=? )` returns a float indicating
11781178whether a reference string comes before or after, or is the same as the given
1179- string in sort order. If `referenceStr` occurs before `compareStr` positive if
1180- the `referenceStr` occurs after `compareStr`, `0` if they are equivalent.
1181- Do not rely on exact return values of `-1` or `1`
1179+ string in sort order. Returns a negative value if `referenceStr` occurs before `compareStr`,
1180+ positive if `referenceStr` occurs after `compareStr`, `0` if they are equivalent.
1181+ Do not rely on exact return values of `-1` or `1`.
1182+
1183+ Optionally takes `~locales` to specify locale(s) and `~options` to customize comparison behavior
1184+ (e.g., sensitivity, case ordering, numeric sorting). These correspond to the `Intl.Collator` options.
11821185See [`String.localeCompare`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare) on MDN.
11831186
11841187## Examples
11851188
11861189```rescript
11871190String.localeCompare("a", "c") < 0.0 == true
11881191String.localeCompare("a", "a") == 0.0
1192+ String.localeCompare("a", "b", ~locales=["en-US"]) < 0.0 == true
1193+ String.localeCompare("a", "A", ~locales=["en-US"], ~options={sensitivity: #base}) == 0.0
11891194```
11901195*/
11911196@send
1192- external localeCompare : (string , string ) => float = "localeCompare"
1197+ external localeCompare : (
1198+ string ,
1199+ string ,
1200+ ~locales : array <string >= ?,
1201+ ~options : Stdlib_Intl_Collator .options = ?,
1202+ ) => float = "localeCompare"
11931203
11941204/**
11951205 `ignore(string)` ignores the provided string and returns unit.
0 commit comments