Skip to main content

js_order

Function js_order 

Source
pub fn js_order(left: &str, right: &str) -> Ordering
Expand description

What: Sorts strings the way JavaScript’s default toSorted does: by UTF-16 code units. Why: Manifest and journal order must match the incumbent’s, which differs from byte order only for supplementary-plane characters.

In TS you’d write (pseudocode):

[...values].toSorted()