feature: tiered sort

This commit is contained in:
2024-05-22 09:27:22 +08:00
parent a946012a33
commit 190e43c814
14 changed files with 254 additions and 147 deletions

View File

@@ -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
}