Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
// Do work!


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylesilva102 lets plan a zoom call to walk through this.

function validatePassword(password) {
let upperCaseCheck = false
let lowerCaseCheck = false
let numbersCheck = false
let specialCheck = false

if (password.length >= 8) { //checking for password length if true to the following
// this for loop loops through each letter the password
for(let i = 0; i < password.length; i++){
if (password.charAt(i) != password.charAt(i).toUpperCase()) {
upperCaseCheck = true
}
if (password.charAt(i) != password.charAt(i).toLowerCase()) {
lowerCaseCheck = true
}
if (/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g.test(password.charAt(i))){
specialCheck = true
}
if (!isNaN(password.charAt(i))) {
numbersCheck = true
}

}
if (upperCaseCheck == true && lowerCaseCheck == true && specialCheck == true && numbersCheck == true) {
return true

} else {
return false
}
} else {
return false
}




}


module.exports = validatePassword