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

Account/channel descriptions are not required anymore

This commit is contained in:
Chocobozzz 2018-05-09 11:23:14 +02:00
parent bf69686953
commit 360329cc02
No known key found for this signature in database
GPG key ID: 583A612D890159BE
9 changed files with 100 additions and 61 deletions

View file

@ -25,10 +25,22 @@ function isIdOrUUIDValid (value: string) {
return isIdValid(value) || isUUIDValid(value)
}
function isBooleanValid (value: string) {
function isBooleanValid (value: any) {
return typeof value === 'boolean' || (typeof value === 'string' && validator.isBoolean(value))
}
function toIntOrNull (value: string) {
if (value === 'null') return null
return validator.toInt(value)
}
function toStringOrNull (value: string) {
if (value === 'null') return null
return value
}
function isFileValid (
files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[],
mimeTypeRegex: string,
@ -61,6 +73,8 @@ export {
isUUIDValid,
isIdOrUUIDValid,
isDateValid,
toStringOrNull,
isBooleanValid,
toIntOrNull,
isFileValid
}