1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-10-31 07:11:47 +09:00

Fix bool-param-default

This commit is contained in:
Acid Chicken (硫酸鶏) 2019-02-23 17:21:59 +09:00 committed by GitHub
parent 0709cac97f
commit 4ad7632113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,7 +172,7 @@ export const isRemoteUser = (user: any): user is IRemoteUser =>
!isLocalUser(user);
//#region Validators
export function validateUsername(username: string, remote?: boolean): boolean {
export function validateUsername(username: string, remote = false): boolean {
return typeof username == 'string' && (remote ? /^\w([\w-]*\w)?$/ : /^\w{1,20}$/).test(username);
}