issue #37
All checks were successful
Test CI / build (push) Successful in 16s

- 기능 구현 1차 완료(동작 확인 필요)
This commit is contained in:
geonhee-min
2025-12-02 16:50:24 +09:00
parent eec883ac32
commit af3fa26f3b
24 changed files with 519 additions and 97 deletions

View File

@@ -1,7 +1,22 @@
export class Validator {
static isEmail = (value: any) => {
if (typeof value !== 'string') return false;
const email = value.trim();
return /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(email);
};
if (typeof value !== 'string') return false;
const email = value.trim();
return /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/.test(email);
};
static validatePasswordFormat = (password: string): boolean => {
if (password.length < 8) return false;
const alphabets = 'abcdefghijklmnopqrstuvwxyz';
const numbers = '0123456789';
const specials = '!@#$%^';
if (!alphabets.includes(password[0])) return false;
const hasNumber = [...numbers].some((char) => password.includes(char));
const hasSpecial = [...specials].some((char) => password.includes(char));
return hasNumber && hasSpecial;
}
}