We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b8d975 commit 8499ca3Copy full SHA for 8499ca3
Sprint-3/3-stretch/password-validator.js
@@ -1,6 +1,30 @@
1
-function passwordValidator(password) {
2
- return password.length < 5 ? false : true
3
-}
+const passwords = ["Amtf22#", "123$cdo"];
+function passwordValidator(password) {
+ if (password.length < 5) {
4
+ return false;
5
+ }
6
+
7
+ if (!/[A-Z]/.test(password)) {
8
9
10
11
+ if (!/[a-z]/.test(password)) {
12
13
14
15
+ if (!/[0-9]/.test(password)) {
16
17
18
+ if (!/[!#$%&? "]/.test(password)) {
19
20
21
22
+ if (passwords.includes(password)) {
23
24
25
26
27
+ return true;
28
+}
29
30
module.exports = passwordValidator;
0 commit comments