* Update parser.ts

* Update user.ts

* Update search.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update parser.ts

* Update mfm.ts

* Update parser.ts

* Merge branch 'develop' into 3440-mk2

* Fix typo

* Update parser.ts

* Update mfm.ts

* Update mfm.ts
This commit is contained in:
Acid Chicken (硫酸鶏) 2018-12-17 19:11:38 +09:00 committed by Aya Morisawa
parent 82d721d60b
commit 3bcb344ecb
4 changed files with 19 additions and 3 deletions

View file

@ -155,7 +155,7 @@ export const isRemoteUser = (user: any): user is IRemoteUser =>
//#region Validators
export function validateUsername(username: string, remote?: boolean): boolean {
return typeof username == 'string' && (remote ? /^\w+([\w\.-]+\w+)?$/ : /^[a-zA-Z0-9_]{1,20}$/).test(username);
return typeof username == 'string' && (remote ? /^\w([\w-]*\w)?$/ : /^\w{1,20}$/).test(username);
}
export function validatePassword(password: string): boolean {