UNPKG

arrow-utils

Version:

arrow-utils library binds array and object methods.Complex Array and Object operations are made simple

1 lines 395 B
exports.passwordStrength=function(t){if(console.log("string ",t),t&&t.length>0){var r=/[0-9]/g,e=/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/g,g=/[a-z]/gi,n=0,a=0,h=0,o=0;return(t=t.toString().trim()).match(r)&&(n=t.match(r).length),t.match(g)&&(a=t.match(g).length),t.match(e)&&(h=t.match(e).length),o+=n>=3?3:n,o+=h>=3?3:h,(o+=a>=6?4:a)>=9?"Strong":o>=6?"Average":"Weak"}return"password is empty"};