sort-array
sort-array copied to clipboard
Add input validation
Low priority but would be nice to have some input validation which ensures the config supplied is valid. E.g. ensure a customOrder is either a function or array of values. The following is invalid and should raise an "invalid config" exception:
sortArray(arr, {
by: 'something',
order: 'broken',
customOrders: {
broken: new Date()
}
})