logical operations between global rules
beskar-developer opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
There is just pipe(&& or and) that can be applied to global rules. I sometimes need or, not, and ... operators to be applied to my rules. This comes with a lot of limitations and I must define a custom rule for each one of these scenarios and could not find another way to do it.
Describe the solution you'd like
I want the ability to write logical phrases for rules for example required||alpha
(|| means or
and not pipe) or required|!alpha
. The syntax must improve and it is just a random thought. The object form must support something similar as well.
Describe alternatives you've considered
I did not though a lot about it and don't know what will happen for Yup, Zod, and more if this feature is added. It just seems to be right to have this feature and parsing the rules may be difficult but it worth the effort!
Having full boolean expressions like with ()
and &&
is probably ruled out for the very long term since it requires a lot of work and time that I do not have.
Negation is possible but would be a breaking change, so we may need to consider it for v5.
This doesn't affect zod or yup in any way which makes it easier to add.
Having full boolean expressions like with
()
and&&
is probably ruled out for the very long term since it requires a lot of work and time that I do not have.Negation is possible but would be a breaking change, so we may need to consider it for v5.
This doesn't affect zod or yup in any way which makes it easier to add.
Thanks for your answer. I would be happy to contribute to this matter if it is possible.