Closed rauschma closed 3 years ago
That is the best you can do right now. You could also use a custom validator with ow.array.validate(…)
. But I agree it would we useful to have a built-in validator for this. What would be the ideal API? Maybe something like ow.array.exactShape([ow.string, ow.number])
?
Using the same method name as ow.object.exactShape()
seems like the right approach, yes.
What is the best way to check for the tuple type
[string, number]
in Ow?This is the best that I can come up with: