( ...orders: ReadonlyArray<Order.Order<ReadonlyArray.Infer<S>>> )
| 2257 | * @since 2.0.0 |
| 2258 | */ |
| 2259 | export const sortBy = <S extends Iterable<any>>( |
| 2260 | ...orders: ReadonlyArray<Order.Order<ReadonlyArray.Infer<S>>> |
| 2261 | ) => { |
| 2262 | const sortByAll = sort(Order.combineAll(orders)) |
| 2263 | return ( |
| 2264 | self: S |
| 2265 | ): S extends NonEmptyReadonlyArray<infer A> ? NonEmptyArray<A> : S extends Iterable<infer A> ? Array<A> : never => { |
| 2266 | const input = fromIterable(self) |
| 2267 | if (isReadonlyArrayNonEmpty(input)) { |
| 2268 | return sortByAll(input) as any |
| 2269 | } |
| 2270 | return [] as any |
| 2271 | } |
| 2272 | } |
| 2273 | |
| 2274 | /** |
| 2275 | * Pairs elements from two iterables by position. If the iterables differ in |
nothing calls this directly
no test coverage detected