sort-array icon indicating copy to clipboard operation
sort-array copied to clipboard

Add input validation

Open 75lb opened this issue 4 years ago • 0 comments

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()
  }
})

75lb avatar Sep 05 '21 16:09 75lb