cal.pub0.org/packages/features/auth/lib/validPassword.ts

10 lines
226 B
TypeScript

export function validPassword(password: string) {
if (password.length < 7) return false;
if (!/[A-Z]/.test(password) || !/[a-z]/.test(password)) return false;
if (!/\d+/.test(password)) return false;
return true;
}