( ...orders: ReadonlyArray<Order.Order<ReadonlyArray.Infer<S>>> )
| 2165 | export const sortBy = <S extends Iterable<any>>( |
| 2166 | ...orders: ReadonlyArray<Order.Order<ReadonlyArray.Infer<S>>> |
| 2167 | ) => { |
| 2168 | const sortByAll = sort(Order.combineAll(orders)) |
| 2169 | return ( |
| 2170 | self: S |
| 2171 | ): S extends NonEmptyReadonlyArray<infer A> ? NonEmptyArray<A> : S extends Iterable<infer A> ? Array<A> : never => { |
| 2172 | const input = fromIterable(self) |
| 2173 | if (isReadonlyArrayNonEmpty(input)) { |
| 2174 | return sortByAll(input) as any |
| 2175 | } |
| 2176 | return [] as any |
| 2177 | } |
| 2178 | } |
| 2179 | |
| 2180 | /** |
| 2181 | * Pairs elements from two iterables by position. If the iterables differ in |
| 2182 | * length, the extra elements from the longer one are discarded. |
| 2183 | * |
nothing calls this directly
no test coverage detected
searching dependent graphs…