Function
sorted
(iterable: Iterable<T>, how: (a: T, b: T) => 0 | 1 | -1)
Source from the content-addressed store, hash-verified
| 313 | }; |
| 314 | |
| 315 | export const sorted = <T>(iterable: Iterable<T>, how: (a: T, b: T) => 0 | 1 | -1) => { |
| 316 | if (typeof how !== 'function') { |
| 317 | throw new TypeError('must provide a "how" function to sorted'); |
| 318 | } |
| 319 | const items = Array.from(iterable); |
| 320 | items.sort(how); |
| 321 | return items; |
| 322 | }; |
| 323 | |
| 324 | /** |
| 325 | * This helper method is necessary as the changes in NODE-4720 required the Topology constructor to |
Tested by
no test coverage detected