aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/user-notifications.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-03-11 10:55:09 +0100
committerChocobozzz <me@florianbigard.com>2021-03-24 18:18:40 +0100
commit829523cfa5177a1810d9373f9a25bf3b18138d1e (patch)
tree0e4604f768c24220a486685ccb2938b95d5251e3 /server/helpers/custom-validators/user-notifications.ts
parent5d43dae3699d088698560851cb6f35f3dbc70c69 (diff)
downloadPeerTube-829523cfa5177a1810d9373f9a25bf3b18138d1e.tar.gz
PeerTube-829523cfa5177a1810d9373f9a25bf3b18138d1e.tar.zst
PeerTube-829523cfa5177a1810d9373f9a25bf3b18138d1e.zip
Reduce bundle size using a const enum
Diffstat (limited to 'server/helpers/custom-validators/user-notifications.ts')
-rw-r--r--server/helpers/custom-validators/user-notifications.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/user-notifications.ts b/server/helpers/custom-validators/user-notifications.ts
index 8a33b895b..252c107db 100644
--- a/server/helpers/custom-validators/user-notifications.ts
+++ b/server/helpers/custom-validators/user-notifications.ts
@@ -1,10 +1,9 @@
1import { exists } from './misc'
2import validator from 'validator' 1import validator from 'validator'
3import { UserNotificationType } from '../../../shared/models/users'
4import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' 2import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'
3import { exists } from './misc'
5 4
6function isUserNotificationTypeValid (value: any) { 5function isUserNotificationTypeValid (value: any) {
7 return exists(value) && validator.isInt('' + value) && UserNotificationType[value] !== undefined 6 return exists(value) && validator.isInt('' + value)
8} 7}
9 8
10function isUserNotificationSettingValid (value: any) { 9function isUserNotificationSettingValid (value: any) {