joi
joi copied to clipboard
Allow in newer versions doesn't seem to be backwards compatible?
trafficstars
Support plan
- is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): no
Context
- node version: v14.17.5
- module version: 17.4.2 (tried other versions also)
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): N/A
- any other relevant information: N/A
How can we help?
joi.string().allow('HEAD').hex().min(6).max(40).lowercase().required() does not allow for the string HEAD, which is explicitly allowed. Can someone explain what I am doing wrong?
Looks like I can work around this with this joi.alternatives(joi.string().valid('HEAD'), joi.string().hex().min(6).max(40).lowercase()).required().