Nested composed validators do not curry as expected.
* This may just be a misunderstanding of the lib is intended to work.
Expected:
// imagine I have created a validator `containsNoNumbers`
const isName = composeValidators(hasLengthBetween(2, 32), containsNoNumbers)
composeValidators(isRequired, isName)('First Name')
composeValidators(isRequired, isName)('Last Name')
isRerquired works as expected and allows the field to propagate through. isName however always returns a function. I can fix the issue by doing something like:
const isName = composeValidators(hasLengthBetween(2, 32), containsNoNumbers)
composeValidators(isRequired, isName('First Name'))('First Name')
composeValidators(isRequired, isName('Last Name'))('Last Name')
but it seems as though the composed validator should work exactly the same as a created validator.
The composed validator is also curried and takes the same arguments as an individual validator made with createValidator.
Nested composed validators do not curry as expected.
* This may just be a misunderstanding of the lib is intended to work.
Expected:
isRerquiredworks as expected and allows the field to propagate through.isNamehowever always returns a function. I can fix the issue by doing something like:but it seems as though the composed validator should work exactly the same as a created validator.