X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fusers.ts;h=9df550fc21227bae8845f665d1039f3164335dd7;hb=2a4c0d8bbe29178ae90e776bb9453f86e6d23bd9;hp=8a6f6fca121c133eb4db5da5a2678b57660198dd;hpb=35a0a924830d84f9ec28c129ec85cb1f45011fb8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts index 8a6f6fca1..9df550fc2 100644 --- a/server/helpers/custom-validators/users.ts +++ b/server/helpers/custom-validators/users.ts @@ -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) {