diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/i18n/i18n.ts | 6 | ||||
-rw-r--r-- | shared/models/users/user-role.ts | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts index 36688382d..27b911b75 100644 --- a/shared/models/i18n/i18n.ts +++ b/shared/models/i18n/i18n.ts | |||
@@ -69,11 +69,11 @@ export function peertubeTranslate (str: string, translations?: { [ id: string ]: | |||
69 | 69 | ||
70 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) | 70 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) |
71 | export function is18nPath (path: string) { | 71 | export function is18nPath (path: string) { |
72 | return possiblePaths.indexOf(path) !== -1 | 72 | return possiblePaths.includes(path) |
73 | } | 73 | } |
74 | 74 | ||
75 | export function is18nLocale (locale: string) { | 75 | export function is18nLocale (locale: string) { |
76 | return POSSIBLE_LOCALES.indexOf(locale) !== -1 | 76 | return POSSIBLE_LOCALES.includes(locale) |
77 | } | 77 | } |
78 | 78 | ||
79 | export function getCompleteLocale (locale: string) { | 79 | export function getCompleteLocale (locale: string) { |
@@ -85,7 +85,7 @@ export function getCompleteLocale (locale: string) { | |||
85 | } | 85 | } |
86 | 86 | ||
87 | export function getShortLocale (locale: string) { | 87 | export function getShortLocale (locale: string) { |
88 | if (locale.indexOf('-') === -1) return locale | 88 | if (locale.includes('-') === false) return locale |
89 | 89 | ||
90 | return locale.split('-')[0] | 90 | return locale.split('-')[0] |
91 | } | 91 | } |
diff --git a/shared/models/users/user-role.ts b/shared/models/users/user-role.ts index ae3a0d983..2b08b5850 100644 --- a/shared/models/users/user-role.ts +++ b/shared/models/users/user-role.ts | |||
@@ -38,5 +38,5 @@ const userRoleRights: { [ id in UserRole ]: UserRight[] } = { | |||
38 | export function hasUserRight (userRole: UserRole, userRight: UserRight) { | 38 | export function hasUserRight (userRole: UserRole, userRight: UserRight) { |
39 | const userRights = userRoleRights[userRole] | 39 | const userRights = userRoleRights[userRole] |
40 | 40 | ||
41 | return userRights.indexOf(UserRight.ALL) !== -1 || userRights.indexOf(userRight) !== -1 | 41 | return userRights.includes(UserRight.ALL) || userRights.includes(userRight) |
42 | } | 42 | } |