]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/users.ts
Update iso639 translations for french and deutch
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / users.ts
index c0acb8218b3bc9468a8313b7578ff0521b91d3b5..b59b766def6a037ca0a0272bd08769e8795dd880 100644 (file)
@@ -22,6 +22,10 @@ function isUserUsernameValid (value: string) {
   return exists(value) && validator.matches(value, new RegExp(`^[a-z0-9._]{${min},${max}}$`))
 }
 
+function isUserDisplayNameValid (value: string) {
+  return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.NAME))
+}
+
 function isUserDescriptionValid (value: string) {
   return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.DESCRIPTION))
 }
@@ -60,6 +64,7 @@ export {
   isUserUsernameValid,
   isUserNSFWPolicyValid,
   isUserAutoPlayVideoValid,
+  isUserDisplayNameValid,
   isUserDescriptionValid,
   isAvatarFile
 }