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:
parent
bf69686953
commit
360329cc02
9 changed files with 100 additions and 61 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue