Open jaridmargolin opened 7 years ago
Hey, @jaridmargolin.
Sorry for the misunderstanding. I originally wrote composeValidators
with validators created via createValidator
in mind, so I never thought about the nested way you're trying to use it here. That being said, I don't see any reason why we can't support your use case too.
I'm swamped at the moment, so I may not be able to hop on fixing this immediately. You're welcome to open a PR if you like, though. Just let me know.
Thanks!
I was poking around in the source code but it wasn't immediately clear to me where / what the patch would look like. If I have some more time to dig into a fix, I will.
Thanks for the quick response.
Nested composed validators do not curry as expected.
* This may just be a misunderstanding of the lib is intended to work.
Expected:
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:but it seems as though the composed validator should work exactly the same as a created validator.