feature: tiered sort
This commit is contained in:
@@ -53,6 +53,22 @@ function isPhone(text) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function verifyPassword(password, min) {
|
||||
if (password == null || typeof password !== 'string') {
|
||||
return false;
|
||||
}
|
||||
if (password.length < 8) {
|
||||
return false;
|
||||
}
|
||||
min ??= 3;
|
||||
let secure = 0;
|
||||
if (/[0-9]/.test(password)) { secure++ }
|
||||
if (/[a-z]/.test(password)) { secure++ }
|
||||
if (/[A-Z]/.test(password)) { secure++ }
|
||||
if (/[^0-9a-zA-Z]/.test(password)) { secure++ }
|
||||
return secure >= min;
|
||||
}
|
||||
|
||||
export {
|
||||
// cookie
|
||||
getCookie,
|
||||
@@ -83,5 +99,6 @@ export {
|
||||
debounce,
|
||||
truncate,
|
||||
isEmail,
|
||||
isPhone
|
||||
isPhone,
|
||||
verifyPassword
|
||||
}
|
Reference in New Issue
Block a user