aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
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 /server/controllers
parent9d94e5d7b96332d628ed835c67c2986289ead9b2 (diff)
downloadPeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.tar.gz
PeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.tar.zst
PeerTube-bdd428a6d9138d751f8cde82867022a93f1a76cc.zip
Update dependencies
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/activitypub/inbox.ts4
-rw-r--r--server/controllers/api/search.ts2
-rw-r--r--server/controllers/client.ts2
3 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts
index 3b8fb34a8..c5edf86b7 100644
--- a/server/controllers/activitypub/inbox.ts
+++ b/server/controllers/activitypub/inbox.ts
@@ -56,9 +56,9 @@ function inboxController (req: express.Request, res: express.Response) {
56 const rootActivity: RootActivity = req.body 56 const rootActivity: RootActivity = req.body
57 let activities: Activity[] 57 let activities: Activity[]
58 58
59 if ([ 'Collection', 'CollectionPage' ].indexOf(rootActivity.type) !== -1) { 59 if ([ 'Collection', 'CollectionPage' ].includes(rootActivity.type)) {
60 activities = (rootActivity as ActivityPubCollection).items 60 activities = (rootActivity as ActivityPubCollection).items
61 } else if ([ 'OrderedCollection', 'OrderedCollectionPage' ].indexOf(rootActivity.type) !== -1) { 61 } else if ([ 'OrderedCollection', 'OrderedCollectionPage' ].includes(rootActivity.type)) {
62 activities = (rootActivity as ActivityPubOrderedCollection<Activity>).orderedItems 62 activities = (rootActivity as ActivityPubOrderedCollection<Activity>).orderedItems
63 } else { 63 } else {
64 activities = [ rootActivity as Activity ] 64 activities = [ rootActivity as Activity ]
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts
index 349650aca..16ffbf683 100644
--- a/server/controllers/api/search.ts
+++ b/server/controllers/api/search.ts
@@ -60,7 +60,7 @@ function searchVideoChannels (req: express.Request, res: express.Response) {
60 60
61 // Handle strings like @toto@example.com 61 // Handle strings like @toto@example.com
62 if (parts.length === 3 && parts[0].length === 0) parts.shift() 62 if (parts.length === 3 && parts[0].length === 0) parts.shift()
63 const isWebfingerSearch = parts.length === 2 && parts.every(p => p && p.indexOf(' ') === -1) 63 const isWebfingerSearch = parts.length === 2 && parts.every(p => p && !p.includes(' '))
64 64
65 if (isURISearch || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res) 65 if (isURISearch || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res)
66 66
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index 20689fb58..08c0f1fa6 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -76,7 +76,7 @@ function serveServerTranslations (req: express.Request, res: express.Response) {
76 const locale = req.params.locale 76 const locale = req.params.locale
77 const file = req.params.file 77 const file = req.params.file
78 78
79 if (is18nLocale(locale) && LOCALE_FILES.indexOf(file) !== -1) { 79 if (is18nLocale(locale) && LOCALE_FILES.includes(file)) {
80 const completeLocale = getCompleteLocale(locale) 80 const completeLocale = getCompleteLocale(locale)
81 const completeFileLocale = buildFileLocale(completeLocale) 81 const completeFileLocale = buildFileLocale(completeLocale)
82 82