Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logical operations between global rules #4790

Open
beskar-developer opened this issue Jun 23, 2024 · 2 comments
Open

logical operations between global rules #4790

beskar-developer opened this issue Jun 23, 2024 · 2 comments
Labels
✨ enhancement a "nice to have" feature v5

Comments

@beskar-developer
Copy link

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!

@logaretm logaretm added ✨ enhancement a "nice to have" feature v5 labels Jun 23, 2024
@logaretm
Copy link
Owner

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.

@beskar-developer
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement a "nice to have" feature v5
Projects
None yet
Development

No branches or pull requests

2 participants