Reputation: 7290
joi.string().valid(['foo', 'bar'])
has been deprecated.
Error: Method no longer accepts array arguments: allow
What is the new way of achieving this?
Upvotes: 3
Views: 709
Reputation: 7290
Using spread syntax works perfectly!
joi.string().valid(...['foo', 'bar'])
Upvotes: 6