IreneKnapp/direct-schema

Tuple length does not specify array length

geraintluff opened this issue ยท 4 comments

Honestly, I haven't run it, but there's a line in your code that says:

 if(data.length < schema.items.length) {

That looks like it fails if the data array is shorter than the "items" array.

If so, that's not quite correct - tuple typing assigns schemas to particular data items if they exist. If you want a minimum length as well, you need to specify minItems.

Hmm, thank you for the feedback. I'll look at it sometime soon.

soon? :D ๐Ÿ”œ

Internet never forgets :)

... are people using this library? If so, I can prioritize this. I admit, I'm surprised.