From bdd428a6d9138d751f8cde82867022a93f1a76cc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 Feb 2020 16:03:39 +0100 Subject: Update dependencies --- shared/models/i18n/i18n.ts | 6 +++--- shared/models/users/user-role.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'shared') 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 ]: const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) export function is18nPath (path: string) { - return possiblePaths.indexOf(path) !== -1 + return possiblePaths.includes(path) } export function is18nLocale (locale: string) { - return POSSIBLE_LOCALES.indexOf(locale) !== -1 + return POSSIBLE_LOCALES.includes(locale) } export function getCompleteLocale (locale: string) { @@ -85,7 +85,7 @@ export function getCompleteLocale (locale: string) { } export function getShortLocale (locale: string) { - if (locale.indexOf('-') === -1) return locale + if (locale.includes('-') === false) return locale return locale.split('-')[0] } 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[] } = { export function hasUserRight (userRole: UserRole, userRight: UserRight) { const userRights = userRoleRights[userRole] - return userRights.indexOf(UserRight.ALL) !== -1 || userRights.indexOf(userRight) !== -1 + return userRights.includes(UserRight.ALL) || userRights.includes(userRight) } -- cgit v1.2.3