1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Prefer using Object.values

This commit is contained in:
Chocobozzz 2022-08-17 15:36:03 +02:00
parent bbd5aa7ead
commit 690bb8f9f3
No known key found for this signature in database
GPG key ID: 583A612D890159BE
17 changed files with 48 additions and 48 deletions

View file

@ -1,4 +1,3 @@
import { values } from 'lodash'
import validator from 'validator'
import { UserRole } from '@shared/models'
import { isEmailEnabled } from '../../initializers/config'
@ -44,9 +43,9 @@ function isUserEmailVerifiedValid (value: any) {
return isBooleanValid(value)
}
const nsfwPolicies = values(NSFW_POLICY_TYPES)
const nsfwPolicies = new Set(Object.values(NSFW_POLICY_TYPES))
function isUserNSFWPolicyValid (value: any) {
return exists(value) && nsfwPolicies.includes(value)
return exists(value) && nsfwPolicies.has(value)
}
function isUserP2PEnabledValid (value: any) {