summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-04-06 01:41:50 +0900
committerGitHub <noreply@github.com>2018-04-06 01:41:50 +0900
commitebacbc4c30adf99d93c29fab057053ddae90fa72 (patch)
tree524ef6938e984957b01fd563a03b499970a00f27 /src/models
parentMerge pull request #1403 from akihikodaki/duplicate (diff)
parentDo not save ๅ็„กใ— as the name of a new user (diff)
downloadmisskey-ebacbc4c30adf99d93c29fab057053ddae90fa72.tar.gz
misskey-ebacbc4c30adf99d93c29fab057053ddae90fa72.tar.bz2
misskey-ebacbc4c30adf99d93c29fab057053ddae90fa72.zip
Merge pull request #1407 from akihikodaki/name
Diffstat (limited to 'src/models')
-rw-r--r--src/models/user.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/models/user.ts b/src/models/user.ts
index f817c33aa2..92091c6879 100644
--- a/src/models/user.ts
+++ b/src/models/user.ts
@@ -21,7 +21,7 @@ type IUserBase = {
deletedAt: Date;
followersCount: number;
followingCount: number;
- name: string;
+ name?: string;
postsCount: number;
driveCapacity: number;
username: string;
@@ -99,8 +99,8 @@ export function validatePassword(password: string): boolean {
return typeof password == 'string' && password != '';
}
-export function isValidName(name: string): boolean {
- return typeof name == 'string' && name.length < 30 && name.trim() != '';
+export function isValidName(name?: string): boolean {
+ return name === null || (typeof name == 'string' && name.length < 30 && name.trim() != '');
}
export function isValidDescription(description: string): boolean {