(key: any)
| 2 | * Usage: array.sort(sortBy('key')) |
| 3 | */ |
| 4 | export const sortBy = (key: any) => { |
| 5 | return (a: any, b: any) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0); |
| 6 | }; |
| 7 | |
| 8 | export const sortByNumeric = (key: any) => { |
| 9 | return (a: any, b: any) => { |
nothing calls this directly
no outgoing calls
no test coverage detected