DEV Community

Discussion on: Password Creation in Svelte

Collapse
 
barim profile image
CodeCadim by Brahim Hamdouni

I'm not sure it's worth it to separate in individual components for each check for such a small piece of code : we loose the global readability of the rules to apply to the password.

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

Separating them provides the ability to create different rules for different passwords. Most systems require only one password, but a few might require different passwords with different restrictions. Furthermore, if this ultimately were encapsulated in a library, for it to be the most effective cannot impose a fixed set of password rules. It needs to be versatile.

Thread Thread
 
barim profile image
CodeCadim by Brahim Hamdouni

totally agree for this contexts it makes sense :)