diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:36:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 15:36:03 +0200 |
commit | 690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3 (patch) | |
tree | b16b8536acd2098aba8c1d6fe13a336dd6aa01a9 /server/helpers/custom-validators/users.ts | |
parent | bbd5aa7ead5f1554a0872963f957effc26d8c630 (diff) | |
download | PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.tar.gz PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.tar.zst PeerTube-690bb8f9f3413147a4f71d5ff0a3cd8170a94ce3.zip |
Prefer using Object.values
Diffstat (limited to 'server/helpers/custom-validators/users.ts')
-rw-r--r-- | server/helpers/custom-validators/users.ts | 5 |
1 files changed, 2 insertions, 3 deletions
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 @@ | |||
1 | import { values } from 'lodash' | ||
2 | import validator from 'validator' | 1 | import validator from 'validator' |
3 | import { UserRole } from '@shared/models' | 2 | import { UserRole } from '@shared/models' |
4 | import { isEmailEnabled } from '../../initializers/config' | 3 | import { isEmailEnabled } from '../../initializers/config' |
@@ -44,9 +43,9 @@ function isUserEmailVerifiedValid (value: any) { | |||
44 | return isBooleanValid(value) | 43 | return isBooleanValid(value) |
45 | } | 44 | } |
46 | 45 | ||
47 | const nsfwPolicies = values(NSFW_POLICY_TYPES) | 46 | const nsfwPolicies = new Set(Object.values(NSFW_POLICY_TYPES)) |
48 | function isUserNSFWPolicyValid (value: any) { | 47 | function isUserNSFWPolicyValid (value: any) { |
49 | return exists(value) && nsfwPolicies.includes(value) | 48 | return exists(value) && nsfwPolicies.has(value) |
50 | } | 49 | } |
51 | 50 | ||
52 | function isUserP2PEnabledValid (value: any) { | 51 | function isUserP2PEnabledValid (value: any) { |