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

Idea: Unifying sanitizing in validators #2158

Open
WikiRik opened this issue Jan 30, 2023 · 0 comments
Open

Idea: Unifying sanitizing in validators #2158

WikiRik opened this issue Jan 30, 2023 · 0 comments

Comments

@WikiRik
Copy link
Member

WikiRik commented Jan 30, 2023

Just making an issue now so we don't forget about it, but we'll discuss this in the future. In #2144 (comment) and #2157 (comment) it came up how the validators should handle sanitization (if at all). We should try to unify it through the various validators so it is clear to the user what their role is. This might also be considered a breaking change so I don't think we need to change this anytime soon (and even so we can start with an opt-in possibly)

Examples of current sanitization include;

const sanitized = str.trim();

const sanitized = card.replace(/[- ]+/g, '');

const sanitized = str.replace(/[\s-]+/g, '');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant