Update dependencies

This commit is contained in:
Chocobozzz
2020-02-28 16:03:39 +01:00
parent 9d94e5d7b9
commit bdd428a6d9
33 changed files with 347 additions and 343 deletions

View File

@@ -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]
}

View File

@@ -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)
}