You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constow=require('ow')constarray=ow.arrayow([1],array)// okow([''],array.ofType(ow.string))// okow([1],array)// ArgumentError: (array) Expected `item` to be of type `string` but received type `number`
Many users won't hit this because ow.array and all the other props return a new value every time they're accessed. This should probably be documented at a minimum, but I wondered if there'd be any interest in a refactor to make the Predicates and their validators immutable, and replace addValidator with withValidator or similar which would return a new instance.
The text was updated successfully, but these errors were encountered:
This can lead to some pretty strange behaviour:
Many users won't hit this because
ow.array
and all the other props return a new value every time they're accessed. This should probably be documented at a minimum, but I wondered if there'd be any interest in a refactor to make thePredicate
s and theirvalidators
immutable, and replaceaddValidator
withwithValidator
or similar which would return a new instance.The text was updated successfully, but these errors were encountered: