sindresorhus / ow

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

Return array of errors throw in `ow.any` #205

Closed taylorjdawson closed 3 years ago

taylorjdawson commented 3 years ago

Currently when using ow.any if all of the predicates fail we get 1 giant string of all of the errors that the predicates threw. It would be nice if the ArgumentError could have an array of all of the errors that get thrown but without the Any predicate failed with the following errors: string appended to it. I see that ArgumentError does have a validationErrors property but those errors have the aforementioned string appended to it. I'd like just the raw predicate errors in the order that they were thrown.