aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-02-28 16:03:39 +0100
committerChocobozzz <me@florianbigard.com>2020-02-28 16:21:34 +0100
commitbdd428a6d9138d751f8cde82867022a93f1a76cc (patch)
treec2b671c3d6a34daddd20e30656f573cf59905f13 /shared
parent9d94e5d7b96332d628ed835c67c2986289ead9b2 (diff)
downloadPeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.tar.gz
PeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.tar.zst
PeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.zip
Update dependencies
Diffstat (limited to 'shared')
-rw-r--r--shared/models/i18n/i18n.ts6
-rw-r--r--shared/models/users/user-role.ts2
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
70const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) 70const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l)
71export function is18nPath (path: string) { 71export function is18nPath (path: string) {
72 return possiblePaths.indexOf(path) !== -1 72 return possiblePaths.includes(path)
73} 73}
74 74
75export function is18nLocale (locale: string) { 75export function is18nLocale (locale: string) {
76 return POSSIBLE_LOCALES.indexOf(locale) !== -1 76 return POSSIBLE_LOCALES.includes(locale)
77} 77}
78 78
79export function getCompleteLocale (locale: string) { 79export function getCompleteLocale (locale: string) {
@@ -85,7 +85,7 @@ export function getCompleteLocale (locale: string) {
85} 85}
86 86
87export function getShortLocale (locale: string) { 87export 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[] } = {
38export function hasUserRight (userRole: UserRole, userRight: UserRight) { 38export 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}