mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
move to boolean switch
This commit is contained in:
parent
64cc5e8575
commit
ed638e5325
13 changed files with 47 additions and 58 deletions
|
@ -1,7 +1,7 @@
|
|||
import 'express-validator'
|
||||
import * as validator from 'validator'
|
||||
import { UserRole } from '../../../shared'
|
||||
import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES, WEBTORRENT_POLICY_TYPES } from '../../initializers'
|
||||
import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers'
|
||||
import { exists, isFileValid, isBooleanValid } from './misc'
|
||||
import { values } from 'lodash'
|
||||
|
||||
|
@ -42,9 +42,8 @@ function isUserNSFWPolicyValid (value: any) {
|
|||
return exists(value) && nsfwPolicies.indexOf(value) !== -1
|
||||
}
|
||||
|
||||
const webTorrentPolicies = values(WEBTORRENT_POLICY_TYPES)
|
||||
function isUserWebTorrentPolicyValid (value: any) {
|
||||
return exists(value) && webTorrentPolicies.indexOf(value) !== -1
|
||||
function isUserWebTorrentEnabledValid (value: any) {
|
||||
return isBooleanValid(value)
|
||||
}
|
||||
|
||||
function isUserAutoPlayVideoValid (value: any) {
|
||||
|
@ -83,7 +82,7 @@ export {
|
|||
isUserUsernameValid,
|
||||
isUserEmailVerifiedValid,
|
||||
isUserNSFWPolicyValid,
|
||||
isUserWebTorrentPolicyValid,
|
||||
isUserWebTorrentEnabledValid,
|
||||
isUserAutoPlayVideoValid,
|
||||
isUserDisplayNameValid,
|
||||
isUserDescriptionValid,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue