import type { ImmutableArray } from "@tsplus/stdlib/collections/ImmutableArray" /** * Sort the elements of an `ImmutableArray` in increasing order, where * elements are compared using first `ords[0]`, then `ords[1]`, then `ords[2]`, * etc. * * @tsplus static ImmutableArray.Aspects sortBy * @tsplus pipeable ImmutableArray sortBy */ export function sortBy(...ords: Array>) { return (self: ImmutableArray): ImmutableArray => { const O = Ord.consecutive(...ords) return self.sort(O) } }