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

Fix scheduled privacy and verify email validations

This commit is contained in:
Chocobozzz 2019-07-25 17:28:45 +02:00
parent 552d95b1e6
commit 2b65c4e535
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 7 additions and 12 deletions

View file

@ -1,7 +1,6 @@
import 'multer'
import * as validator from 'validator'
import { sep } from 'path'
import toBoolean = require('validator/lib/toBoolean')
function exists (value: any) {
return value !== undefined && value !== null
@ -52,7 +51,7 @@ function toIntOrNull (value: string) {
if (v === null || v === undefined) return v
if (typeof v === 'number') return v
return validator.toInt(v)
return validator.toInt('' + v)
}
function toBooleanOrNull (value: any) {
@ -61,7 +60,7 @@ function toBooleanOrNull (value: any) {
if (v === null || v === undefined) return v
if (typeof v === 'boolean') return v
return toBoolean(v)
return validator.toBoolean('' + v)
}
function toValueOrNull (value: string) {