Converts an object to a sorted array of [key, value] tuples.
The input object type
Optional
The object to convert
Optional function to transform values during sorting
Array of [key, value] tuples sorted by key
const sorted = toSortedArray({ z: 3, a: 1, m: 2 });// [['a', 1], ['m', 2], ['z', 3]] Copy
const sorted = toSortedArray({ z: 3, a: 1, m: 2 });// [['a', 1], ['m', 2], ['z', 3]]
Converts an object to a sorted array of [key, value] tuples.