1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Implement support field in video and video channel

This commit is contained in:
Chocobozzz 2018-02-15 14:46:26 +01:00
parent 34cbef8c6c
commit 2422c46b27
No known key found for this signature in database
GPG key ID: 583A612D890159BE
49 changed files with 490 additions and 146 deletions

View file

@ -21,6 +21,10 @@ function isUserUsernameValid (value: string) {
return exists(value) && validator.matches(value, new RegExp(`^[a-z0-9._]{${min},${max}}$`))
}
function isUserDescriptionValid (value: string) {
return value === null || (exists(value) && validator.isLength(value, CONSTRAINTS_FIELDS.USERS.DESCRIPTION))
}
function isBoolean (value: any) {
return typeof value === 'boolean' || (typeof value === 'string' && validator.isBoolean(value))
}
@ -54,5 +58,6 @@ export {
isUserUsernameValid,
isUserDisplayNSFWValid,
isUserAutoPlayVideoValid,
isUserDescriptionValid,
isAvatarFile
}