( ...orders: ReadonlyArray<Order.Order<ReadonlyArray.Infer<S>>> )
| 1532 | * @since 2.0.0 |
| 1533 | */ |
| 1534 | export const sortBy = <S extends Iterable<any>>( |
| 1535 | ...orders: ReadonlyArray<Order.Order<ReadonlyArray.Infer<S>>> |
| 1536 | ) => { |
| 1537 | const sortByAll = sort(Order.combineAll(orders)) |
| 1538 | return ( |
| 1539 | self: S |
| 1540 | ): S extends NonEmptyReadonlyArray<infer A> ? NonEmptyArray<A> : S extends Iterable<infer A> ? Array<A> : never => { |
| 1541 | const input = fromIterable(self) |
| 1542 | if (isNonEmptyReadonlyArray(input)) { |
| 1543 | return sortByAll(input) as any |
| 1544 | } |
| 1545 | return [] as any |
| 1546 | } |
| 1547 | } |
| 1548 | |
| 1549 | /** |
| 1550 | * Takes two `Iterable`s and returns an `Array` of corresponding pairs. |
nothing calls this directly
no test coverage detected