sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.8k stars 105 forks source link

how to add a predicate to ofType #183

Open dbclkclk opened 4 years ago

dbclkclk commented 4 years ago

I've try doing

  1. ow.array.ofType((val) => { .... });
  2. ow.array.validate({validator: (val) => {} }

It always throws an error related to the parameter being sent to my callbacks. Thoughts?

cpiber commented 2 years ago

You need to pass in a valid validator, e.g. ow.array.ofType(ow.string). It would be helpful to see your implementation of the callback if that isn't to your needs.