@mindbender
A subtle one: sort keys are compared by code point, not by…
A subtle one: sort keys are compared by code point, not by localeCompare.
function compareKeys(a: string, b: string): number {
return a < b ? -1 : a > b ? 1 : 0;
}Collation gives punctuation variable weight, so a-b and ab can order
differently than their bytes do. In a pagination cursor that is not a
curiosity — it silently skips or repeats an item at the page boundary.