Created
          December 2, 2020 07:52 
        
      - 
      
- 
        Save mayowDev/95270b2a697fa03889a1ae74539fa35d to your computer and use it in GitHub Desktop. 
Revisions
- 
        mayowDev created this gist Dec 2, 2020 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ > Your password must be at least 8 characters long and include at least one number and one of the following symbols !@#$%^&()* const isEmailValid = (mail) => { if (mail) { return /^\S+@\S+\.\S+$/.test(mail) === true } return true } const isPasswordValid = (pass) => { if (pass) { return pass.length > 7 && /^(?=.*\d)(?=.*[a-z])(?=.*[!@#$%^&()*])(?=.*[a-z]).{8,}$/i.test(pass) === true } return true } const checkPassword = (password) => { if (password.length >= 1) { const isValid = isPasswordValid(password) console.log('isValid = ', isValid, password) setPasswordValid(isValid) } }