From 42ed35bfc95147c89cb0dc3d61d8982b2646c1ca Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 3 Mar 2017 09:24:17 +0900 Subject: wip --- src/api/models/user.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/api/models') diff --git a/src/api/models/user.ts b/src/api/models/user.ts index 5ab39d7c92..cd16459891 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -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); } -- cgit v1.2.3-freya