Export analyzePassword Function
Initially pointed out in #1966 to adapt isStrongPassword to return count of all type of characters in the password.
The responsibility of isStrongPassword should only be to check if the password is strong or not. So instead of modifying isStrongPassword, analyzePassword is exported which can be used to know the count of all type of characters in the password.
The issue is also attempted to solve here #2033
Checklist
- [x] PR contains only changes related; no stray files, etc.
- [x] README updated (where applicable)
- [ ] Tests written (where applicable)
- [x] References provided in PR (where applicable)
I guess we should also include tests for it individually. Also could you fix the failed tests
just my 2 cents here: but it feels like this would not really fit the scope of the project - you have validators and sanitizers in here, this analyzePassword function does not really fit into any category.
But this is not really my decision to make - so maybe to be discussed?
I completely understand the concern regarding the scope of the project, as analyzePassword doesn’t fit neatly into the validator or sanitizer categories. Then we might need to fall back to the initial idea of extending the isStrongPassword function with an option to return analysis, but again I feel that's not the responsibility of isStrongPassword. I'm happy to take it in either direction based on what fits best with the project’s goals.
Hello all, any updates on this? I'm totally keen on this feature for my website, please. Thanks :)