This commit is contained in:
syuilo
2017-03-03 09:24:17 +09:00
parent 665bcda0a7
commit 42ed35bfc9
2 changed files with 24 additions and 35 deletions

View File

@@ -19,6 +19,14 @@ export function isValidName(name: string): boolean {
return typeof name == 'string' && name.length < 30 && name.trim() != '';
}
export function isValidDescription(description: string): boolean {
return typeof description == 'string' && description.length < 500 && description.trim() != '';
}
export function isValidLocation(location: string): boolean {
return typeof location == 'string' && location.length < 50 && location.trim() != '';
}
export function isValidBirthday(birthday: string): boolean {
return typeof birthday == 'string' && /^([0-9]{4})\-([0-9]{2})-([0-9]{2})$/.test(birthday);
}