-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Context
In the 10.0.0 release notes it is said that the pre 10.0.0 functionality can be achieved with:
Joi.boolean().truthy('true', 'yes', 1, '1').falsy('false', 'no', 0, '0')
This is not quite the same as the old schema as the new implementation with set doesn't use the insensitive flag when checking for set membership
Line 31 in aff2519
| result.value = (this._inner.truthySet.has(value) ? true |
Joi.boolean().truthy('true', 'True', 'TRUE', 'yes', 'Yes', 'YES', 1, '1').falsy('false', 'False', 'FALSE', 'no', 'No', 'NO', 0, '0')but still wouldn't cover bizarre capitalization permutations (TRUe) like the previous behavior.
Would you (Joi team) be open to a PR that makes truthy and falsy values entered be case insensitive? I'm willing to do it but want to make sure it fits into the project's roadmap.
- joi version: 10.0.0
- used with (hapi, standalone, ...): hapi
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect