diff options
author | Chocobozzz <me@florianbigard.com> | 2021-03-11 10:55:09 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-03-24 18:18:40 +0100 |
commit | 829523cfa5177a1810d9373f9a25bf3b18138d1e (patch) | |
tree | 0e4604f768c24220a486685ccb2938b95d5251e3 /server/helpers/custom-validators | |
parent | 5d43dae3699d088698560851cb6f35f3dbc70c69 (diff) | |
download | PeerTube-829523cfa5177a1810d9373f9a25bf3b18138d1e.tar.gz PeerTube-829523cfa5177a1810d9373f9a25bf3b18138d1e.tar.zst PeerTube-829523cfa5177a1810d9373f9a25bf3b18138d1e.zip |
Reduce bundle size using a const enum
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/user-notifications.ts | 5 |
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 @@ | |||
1 | import { exists } from './misc' | ||
2 | import validator from 'validator' | 1 | import validator from 'validator' |
3 | import { UserNotificationType } from '../../../shared/models/users' | ||
4 | import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' | 2 | import { UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' |
3 | import { exists } from './misc' | ||
5 | 4 | ||
6 | function isUserNotificationTypeValid (value: any) { | 5 | function isUserNotificationTypeValid (value: any) { |
7 | return exists(value) && validator.isInt('' + value) && UserNotificationType[value] !== undefined | 6 | return exists(value) && validator.isInt('' + value) |
8 | } | 7 | } |
9 | 8 | ||
10 | function isUserNotificationSettingValid (value: any) { | 9 | function isUserNotificationSettingValid (value: any) { |