summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2018-09-01 23:12:51 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2018-09-01 23:12:51 +0900
commit291beb45fcb7a4c856232b12848ebad8267e2840 (patch)
tree8967c4a548ce8a0d19b5e4ef3c8eb37e0d3414d1 /src
parentfix #2315 (#2339) (diff)
downloadsharkey-291beb45fcb7a4c856232b12848ebad8267e2840.tar.gz
sharkey-291beb45fcb7a4c856232b12848ebad8267e2840.tar.bz2
sharkey-291beb45fcb7a4c856232b12848ebad8267e2840.zip
Use string interpolation
Diffstat (limited to 'src')
-rw-r--r--src/client/app/auth/views/index.vue2
-rw-r--r--src/client/app/boot.js2
-rw-r--r--src/client/app/common/scripts/streaming/stream.ts4
-rw-r--r--src/client/app/common/views/components/autocomplete.vue4
-rw-r--r--src/client/app/common/views/components/connect-failed.troubleshooter.vue2
-rw-r--r--src/client/app/common/views/components/url-preview.vue2
-rw-r--r--src/client/app/common/views/directives/autocomplete.ts4
-rw-r--r--src/client/app/common/views/filters/note.ts2
-rw-r--r--src/client/app/common/views/filters/user.ts2
-rw-r--r--src/client/app/common/views/pages/follow.vue2
-rw-r--r--src/client/app/desktop/views/components/drive.folder.vue2
-rw-r--r--src/client/app/desktop/views/components/drive.vue4
-rw-r--r--src/client/app/desktop/views/components/media-image.vue2
-rw-r--r--src/client/app/desktop/views/components/post-form.vue6
-rw-r--r--src/client/app/desktop/views/pages/drive.vue2
-rw-r--r--src/client/app/desktop/views/pages/games/reversi.vue4
-rw-r--r--src/client/app/desktop/views/pages/messaging-room.vue2
-rw-r--r--src/client/app/mobile/views/components/post-form.vue6
-rw-r--r--src/client/app/mobile/views/components/ui.nav.vue2
-rw-r--r--src/client/app/mobile/views/pages/drive.vue4
-rw-r--r--src/client/app/mobile/views/pages/followers.vue2
-rw-r--r--src/client/app/mobile/views/pages/following.vue2
-rw-r--r--src/client/app/mobile/views/pages/games/reversi.vue4
-rw-r--r--src/client/app/mobile/views/pages/settings.vue2
-rw-r--r--src/client/app/mobile/views/pages/user-lists.vue2
-rw-r--r--src/client/app/mobile/views/pages/user.vue2
-rw-r--r--src/daemons/notes-stats.ts2
-rw-r--r--src/daemons/server-stats.ts2
-rw-r--r--src/mfm/html-to-mfm.ts2
-rw-r--r--src/mfm/html.ts4
-rw-r--r--src/misc/fa.ts2
-rw-r--r--src/remote/activitypub/renderer/hashtag.ts2
-rw-r--r--src/server/activitypub.ts2
-rw-r--r--src/server/api/endpoints.ts2
-rw-r--r--src/server/api/stream/notes-stats.ts2
-rw-r--r--src/server/api/stream/server-stats.ts2
-rw-r--r--src/server/web/docs.ts2
-rw-r--r--src/server/web/views/user.pug2
-rw-r--r--src/services/drive/add-file.ts2
39 files changed, 51 insertions, 51 deletions
diff --git a/src/client/app/auth/views/index.vue b/src/client/app/auth/views/index.vue
index 609e758994..ba7df911e5 100644
--- a/src/client/app/auth/views/index.vue
+++ b/src/client/app/auth/views/index.vue
@@ -80,7 +80,7 @@ export default Vue.extend({
accepted() {
this.state = 'accepted';
if (this.session.app.callbackUrl) {
- location.href = this.session.app.callbackUrl + '?token=' + this.session.token;
+ location.href = `${this.session.app.callbackUrl}?token=${this.session.token}`;
}
}
}
diff --git a/src/client/app/boot.js b/src/client/app/boot.js
index 54397c98c6..dd2cf93a89 100644
--- a/src/client/app/boot.js
+++ b/src/client/app/boot.js
@@ -94,7 +94,7 @@
// Get salt query
const salt = localStorage.getItem('salt')
- ? '?salt=' + localStorage.getItem('salt')
+ ? `?salt=${localStorage.getItem('salt')}`
: '';
// Load an app script
diff --git a/src/client/app/common/scripts/streaming/stream.ts b/src/client/app/common/scripts/streaming/stream.ts
index fefa8e5ced..4ab78f1190 100644
--- a/src/client/app/common/scripts/streaming/stream.ts
+++ b/src/client/app/common/scripts/streaming/stream.ts
@@ -44,11 +44,11 @@ export default class Connection extends EventEmitter {
const query = params
? Object.keys(params)
- .map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k]))
+ .map(k => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`)
.join('&')
: null;
- this.socket = new ReconnectingWebsocket(`${wsUrl}/${endpoint}${query ? '?' + query : ''}`);
+ this.socket = new ReconnectingWebsocket(`${wsUrl}/${endpoint}${query ? `?${query}` : ''}`);
this.socket.addEventListener('open', this.onOpen);
this.socket.addEventListener('close', this.onClose);
this.socket.addEventListener('message', this.onMessage);
diff --git a/src/client/app/common/views/components/autocomplete.vue b/src/client/app/common/views/components/autocomplete.vue
index b274eaa0a0..ea05afd6dc 100644
--- a/src/client/app/common/views/components/autocomplete.vue
+++ b/src/client/app/common/views/components/autocomplete.vue
@@ -125,7 +125,7 @@ export default Vue.extend({
}
if (this.type == 'user') {
- const cacheKey = 'autocomplete:user:' + this.q;
+ const cacheKey = `autocomplete:user:${this.q}`;
const cache = sessionStorage.getItem(cacheKey);
if (cache) {
const users = JSON.parse(cache);
@@ -148,7 +148,7 @@ export default Vue.extend({
this.hashtags = JSON.parse(localStorage.getItem('hashtags') || '[]');
this.fetching = false;
} else {
- const cacheKey = 'autocomplete:hashtag:' + this.q;
+ const cacheKey = `autocomplete:hashtag:${this.q}`;
const cache = sessionStorage.getItem(cacheKey);
if (cache) {
const hashtags = JSON.parse(cache);
diff --git a/src/client/app/common/views/components/connect-failed.troubleshooter.vue b/src/client/app/common/views/components/connect-failed.troubleshooter.vue
index 6c23cc7969..f64cae6b4b 100644
--- a/src/client/app/common/views/components/connect-failed.troubleshooter.vue
+++ b/src/client/app/common/views/components/connect-failed.troubleshooter.vue
@@ -57,7 +57,7 @@ export default Vue.extend({
}
// Check internet connection
- fetch('https://google.com?rand=' + Math.random(), {
+ fetch(`https://google.com?rand=${Math.random()}`, {
mode: 'no-cors'
}).then(() => {
this.internet = true;
diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue
index d5dda0c80a..e182e7f8cb 100644
--- a/src/client/app/common/views/components/url-preview.vue
+++ b/src/client/app/common/views/components/url-preview.vue
@@ -170,7 +170,7 @@ export default Vue.extend({
return;
}
- fetch('/url?url=' + encodeURIComponent(this.url)).then(res => {
+ fetch(`/url?url=${encodeURIComponent(this.url)}`).then(res => {
res.json().then(info => {
if (info.url == null) return;
this.title = info.title;
diff --git a/src/client/app/common/views/directives/autocomplete.ts b/src/client/app/common/views/directives/autocomplete.ts
index b252cf5c1f..26bc13871d 100644
--- a/src/client/app/common/views/directives/autocomplete.ts
+++ b/src/client/app/common/views/directives/autocomplete.ts
@@ -191,7 +191,7 @@ class Autocomplete {
const acct = renderAcct(value);
// 挿入
- this.text = trimmedBefore + '@' + acct + ' ' + after;
+ this.text = `${trimmedBefore}@${acct} ${after}`;
// キャレットを戻す
this.vm.$nextTick(() => {
@@ -207,7 +207,7 @@ class Autocomplete {
const after = source.substr(caret);
// 挿入
- this.text = trimmedBefore + '#' + value + ' ' + after;
+ this.text = `${trimmedBefore}#${value} ${after}`;
// キャレットを戻す
this.vm.$nextTick(() => {
diff --git a/src/client/app/common/views/filters/note.ts b/src/client/app/common/views/filters/note.ts
index a611dc8685..3c9c8b7485 100644
--- a/src/client/app/common/views/filters/note.ts
+++ b/src/client/app/common/views/filters/note.ts
@@ -1,5 +1,5 @@
import Vue from 'vue';
Vue.filter('notePage', note => {
- return '/notes/' + note.id;
+ return `/notes/${note.id}`;
});
diff --git a/src/client/app/common/views/filters/user.ts b/src/client/app/common/views/filters/user.ts
index ca0910fc53..e5220229b7 100644
--- a/src/client/app/common/views/filters/user.ts
+++ b/src/client/app/common/views/filters/user.ts
@@ -11,5 +11,5 @@ Vue.filter('userName', user => {
});
Vue.filter('userPage', (user, path?) => {
- return '/@' + Vue.filter('acct')(user) + (path ? '/' + path : '');
+ return `/@${Vue.filter('acct')(user)}${(path ? `/${path}` : '')}`;
});
diff --git a/src/client/app/common/views/pages/follow.vue b/src/client/app/common/views/pages/follow.vue
index 13d855d20a..ec74b3a9b9 100644
--- a/src/client/app/common/views/pages/follow.vue
+++ b/src/client/app/common/views/pages/follow.vue
@@ -1,6 +1,6 @@
<template>
<div class="syxhndwprovvuqhmyvveewmbqayniwkv" v-if="!fetching" :data-darkmode="$store.state.device.darkmode">
- <div class="signed-in-as" v-html="'%i18n:@signed-in-as%'.replace('{}', '<b>' + myName + '</b>')"></div>
+ <div class="signed-in-as" v-html="'%i18n:@signed-in-as%'.replace('{}', `<b>${myName}`)"></div>
<main>
<div class="banner" :style="bannerStyle"></div>
diff --git a/src/client/app/desktop/views/components/drive.folder.vue b/src/client/app/desktop/views/components/drive.folder.vue
index 83880fef5c..e6b71f9426 100644
--- a/src/client/app/desktop/views/components/drive.folder.vue
+++ b/src/client/app/desktop/views/components/drive.folder.vue
@@ -163,7 +163,7 @@ export default Vue.extend({
});
break;
default:
- alert('%i18n:@unhandled-error% ' + err);
+ alert(`%i18n:@unhandled-error% ${err}`);
}
});
}
diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue
index d919e4a5ea..cb289027d4 100644
--- a/src/client/app/desktop/views/components/drive.vue
+++ b/src/client/app/desktop/views/components/drive.vue
@@ -323,7 +323,7 @@ export default Vue.extend({
});
break;
default:
- alert('%i18n:@unhandled-error% ' + err);
+ alert(`%i18n:@unhandled-error% ${err}`);
}
});
}
@@ -404,7 +404,7 @@ export default Vue.extend({
folder: folder
});
} else {
- window.open(url + '/i/drive/folder/' + folder.id,
+ window.open(`${url}/i/drive/folder/${folder.id}`,
'drive_window',
'height=500, width=800');
}
diff --git a/src/client/app/desktop/views/components/media-image.vue b/src/client/app/desktop/views/components/media-image.vue
index 8b68f260fa..52d029a269 100644
--- a/src/client/app/desktop/views/components/media-image.vue
+++ b/src/client/app/desktop/views/components/media-image.vue
@@ -48,7 +48,7 @@ export default Vue.extend({
const mouseY = e.clientY - rect.top;
const xp = mouseX / this.$el.offsetWidth * 100;
const yp = mouseY / this.$el.offsetHeight * 100;
- this.$el.style.backgroundPosition = xp + '% ' + yp + '%';
+ this.$el.style.backgroundPosition = `${xp}% ${yp}%';
this.$el.style.backgroundImage = `url("${this.image.url}")`;
},
diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue
index bacaea65ee..eb8b40062a 100644
--- a/src/client/app/desktop/views/components/post-form.vue
+++ b/src/client/app/desktop/views/components/post-form.vue
@@ -110,9 +110,9 @@ export default Vue.extend({
computed: {
draftId(): string {
return this.renote
- ? 'renote:' + this.renote.id
+ ? `renote:${this.renote.id}`
: this.reply
- ? 'reply:' + this.reply.id
+ ? `reply:${this.reply.id}`
: 'note';
},
@@ -313,7 +313,7 @@ export default Vue.extend({
this.geo = pos.coords;
this.$emit('geo-attached', this.geo);
}, err => {
- alert('%i18n:@error%: ' + err.message);
+ alert(`%i18n:@error%: ${err.message}`);
}, {
enableHighAccuracy: true
});
diff --git a/src/client/app/desktop/views/pages/drive.vue b/src/client/app/desktop/views/pages/drive.vue
index 217dcb7751..dec6c4551a 100644
--- a/src/client/app/desktop/views/pages/drive.vue
+++ b/src/client/app/desktop/views/pages/drive.vue
@@ -31,7 +31,7 @@ export default Vue.extend({
const title = folder.name + ' | %i18n:@title%';
// Rewrite URL
- history.pushState(null, title, '/i/drive/folder/' + folder.id);
+ history.pushState(null, title, `/i/drive/folder/${folder.id}`);
document.title = title;
}
diff --git a/src/client/app/desktop/views/pages/games/reversi.vue b/src/client/app/desktop/views/pages/games/reversi.vue
index ce9b42c65f..1b0e790a22 100644
--- a/src/client/app/desktop/views/pages/games/reversi.vue
+++ b/src/client/app/desktop/views/pages/games/reversi.vue
@@ -16,10 +16,10 @@ export default Vue.extend({
methods: {
nav(game, actualNav) {
if (actualNav) {
- this.$router.push('/reversi/' + game.id);
+ this.$router.push(`/reversi/${game.id}`);
} else {
// TODO: https://github.com/vuejs/vue-router/issues/703
- this.$router.push('/reversi/' + game.id);
+ this.$router.push(`/reversi/${game.id}`);
}
}
}
diff --git a/src/client/app/desktop/views/pages/messaging-room.vue b/src/client/app/desktop/views/pages/messaging-room.vue
index 1ebd53cef4..4be33dda04 100644
--- a/src/client/app/desktop/views/pages/messaging-room.vue
+++ b/src/client/app/desktop/views/pages/messaging-room.vue
@@ -46,7 +46,7 @@ export default Vue.extend({
this.user = user;
this.fetching = false;
- document.title = 'メッセージ: ' + getUserName(this.user);
+ document.title = `メッセージ: ${getUserName(this.user)}`;
Progress.done();
});
diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue
index b076cae26d..8b1f7b08c8 100644
--- a/src/client/app/mobile/views/components/post-form.vue
+++ b/src/client/app/mobile/views/components/post-form.vue
@@ -105,9 +105,9 @@ export default Vue.extend({
computed: {
draftId(): string {
return this.renote
- ? 'renote:' + this.renote.id
+ ? `renote:${this.renote.id}`
: this.reply
- ? 'reply:' + this.reply.id
+ ? `reply:${this.reply.id}`
: 'note';
},
@@ -229,7 +229,7 @@ export default Vue.extend({
navigator.geolocation.getCurrentPosition(pos => {
this.geo = pos.coords;
}, err => {
- alert('%i18n:@error%: ' + err.message);
+ alert(`%i18n:@error%: ${err.message}`);
}, {
enableHighAccuracy: true
});
diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue
index 39ea513b76..54eed1b6d4 100644
--- a/src/client/app/mobile/views/components/ui.nav.vue
+++ b/src/client/app/mobile/views/components/ui.nav.vue
@@ -82,7 +82,7 @@ export default Vue.extend({
search() {
const query = window.prompt('%i18n:@search%');
if (query == null || query == '') return;
- this.$router.push('/search?q=' + encodeURIComponent(query));
+ this.$router.push(`/search?q=${encodeURIComponent(query)}`);
},
onReversiInvited() {
this.hasGameInvitation = true;
diff --git a/src/client/app/mobile/views/pages/drive.vue b/src/client/app/mobile/views/pages/drive.vue
index 657f43c7c3..27ac956043 100644
--- a/src/client/app/mobile/views/pages/drive.vue
+++ b/src/client/app/mobile/views/pages/drive.vue
@@ -80,7 +80,7 @@ export default Vue.extend({
if (!silent) {
// Rewrite URL
- history.pushState(null, title, '/i/drive/folder/' + folder.id);
+ history.pushState(null, title, `/i/drive/folder/${folder.id}`);
}
document.title = title;
@@ -93,7 +93,7 @@ export default Vue.extend({
if (!silent) {
// Rewrite URL
- history.pushState(null, title, '/i/drive/file/' + file.id);
+ history.pushState(null, title, `/i/drive/file/${file.id}`);
}
document.title = title;
diff --git a/src/client/app/mobile/views/pages/followers.vue b/src/client/app/mobile/views/pages/followers.vue
index 421c150856..601f6670c1 100644
--- a/src/client/app/mobile/views/pages/followers.vue
+++ b/src/client/app/mobile/views/pages/followers.vue
@@ -49,7 +49,7 @@ export default Vue.extend({
this.user = user;
this.fetching = false;
- document.title = '%i18n:@followers-of%'.replace('{}', this.name) + ' | ' + (this as any).os.instanceName;
+ document.title = `${'%i18n:@followers-of%'.replace('{}', this.name)} | ${(this as any).os.instanceName}`;
});
},
onLoaded() {
diff --git a/src/client/app/mobile/views/pages/following.vue b/src/client/app/mobile/views/pages/following.vue
index ff201ff2bd..0efac6110e 100644
--- a/src/client/app/mobile/views/pages/following.vue
+++ b/src/client/app/mobile/views/pages/following.vue
@@ -48,7 +48,7 @@ export default Vue.extend({
this.user = user;
this.fetching = false;
- document.title = '%i18n:@followers-of%'.replace('{}', this.name) + ' | ' + (this as any).os.instanceName;
+ document.title = `${'%i18n:@followers-of%'.replace('{}', this.name)} | ${(this as any).os.instanceName}`;
});
},
onLoaded() {
diff --git a/src/client/app/mobile/views/pages/games/reversi.vue b/src/client/app/mobile/views/pages/games/reversi.vue
index d6849a1c11..bdadc88a43 100644
--- a/src/client/app/mobile/views/pages/games/reversi.vue
+++ b/src/client/app/mobile/views/pages/games/reversi.vue
@@ -16,10 +16,10 @@ export default Vue.extend({
methods: {
nav(game, actualNav) {
if (actualNav) {
- this.$router.push('/reversi/' + game.id);
+ this.$router.push(`/reversi/${game.id}`);
} else {
// TODO: https://github.com/vuejs/vue-router/issues/703
- this.$router.push('/reversi/' + game.id);
+ this.$router.push(`/reversi/${game.id}`);
}
}
}
diff --git a/src/client/app/mobile/views/pages/settings.vue b/src/client/app/mobile/views/pages/settings.vue
index 7437eb8b47..838ffd2a6b 100644
--- a/src/client/app/mobile/views/pages/settings.vue
+++ b/src/client/app/mobile/views/pages/settings.vue
@@ -2,7 +2,7 @@
<mk-ui>
<span slot="header">%fa:cog%%i18n:@settings%</span>
<main :data-darkmode="$store.state.device.darkmode">
- <div class="signin-as" v-html="'%i18n:@signed-in-as%'.replace('{}', '<b>' + name + '</b>')"></div>
+ <div class="signin-as" v-html="'%i18n:@signed-in-as%'.replace('{}', `<b>${name}</b>`)"></div>
<div>
<x-profile/>
diff --git a/src/client/app/mobile/views/pages/user-lists.vue b/src/client/app/mobile/views/pages/user-lists.vue
index abd04c1496..5ee0636dea 100644
--- a/src/client/app/mobile/views/pages/user-lists.vue
+++ b/src/client/app/mobile/views/pages/user-lists.vue
@@ -43,7 +43,7 @@ export default Vue.extend({
title
});
- this.$router.push('/i/lists/' + list.id);
+ this.$router.push(`/i/lists/${list.id}`);
});
}
}
diff --git a/src/client/app/mobile/views/pages/user.vue b/src/client/app/mobile/views/pages/user.vue
index 8918847a8f..ddea43c9f2 100644
--- a/src/client/app/mobile/views/pages/user.vue
+++ b/src/client/app/mobile/views/pages/user.vue
@@ -107,7 +107,7 @@ export default Vue.extend({
this.fetching = false;
Progress.done();
- document.title = Vue.filter('userName')(this.user) + ' | ' + (this as any).os.instanceName;
+ document.title = `${Vue.filter('userName')(this.user)} | ${(this as any).os.instanceName}`;
});
}
}
diff --git a/src/daemons/notes-stats.ts b/src/daemons/notes-stats.ts
index 3d2c4820a6..bddb54cfa5 100644
--- a/src/daemons/notes-stats.ts
+++ b/src/daemons/notes-stats.ts
@@ -16,7 +16,7 @@ export default function() {
});
ev.on('requestNotesStatsLog', id => {
- ev.emit('notesStatsLog:' + id, log.toArray());
+ ev.emit(`notesStatsLog:${id}`, log.toArray());
});
process.on('exit', code => {
diff --git a/src/daemons/server-stats.ts b/src/daemons/server-stats.ts
index 4a653f81f4..9bb43fe84e 100644
--- a/src/daemons/server-stats.ts
+++ b/src/daemons/server-stats.ts
@@ -16,7 +16,7 @@ export default function() {
const log = new Deque<any>();
ev.on('requestServerStatsLog', x => {
- ev.emit('serverStatsLog:' + x.id, log.toArray().slice(0, x.length || 50));
+ ev.emit(`serverStatsLog:${x.id}`, log.toArray().slice(0, x.length || 50));
});
async function tick() {
diff --git a/src/mfm/html-to-mfm.ts b/src/mfm/html-to-mfm.ts
index e2681f5447..b476a9af5c 100644
--- a/src/mfm/html-to-mfm.ts
+++ b/src/mfm/html-to-mfm.ts
@@ -45,7 +45,7 @@ export default function(html: string): string {
if (part.length == 2) {
//#region ホスト名部分が省略されているので復元する
- const acct = txt + '@' + (new URL(href.value)).hostname;
+ const acct = `${txt}@${(new URL(href.value)).hostname}`;
text += acct;
break;
//#endregion
diff --git a/src/mfm/html.ts b/src/mfm/html.ts
index c798ee410a..2e38fe10a0 100644
--- a/src/mfm/html.ts
+++ b/src/mfm/html.ts
@@ -44,8 +44,8 @@ const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers:
hashtag({ document }, { hashtag }) {
const a = document.createElement('a');
- a.href = config.url + '/tags/' + hashtag;
- a.textContent = '#' + hashtag;
+ a.href = `${config.url}/tags/${hashtag}`;
+ a.textContent = `#${hashtag}`;
a.setAttribute('rel', 'tag');
document.body.appendChild(a);
},
diff --git a/src/misc/fa.ts b/src/misc/fa.ts
index 8be06362c3..90cdac89b2 100644
--- a/src/misc/fa.ts
+++ b/src/misc/fa.ts
@@ -26,7 +26,7 @@ export const replacement = (match: string, key: string) => {
arg == 'B' ? 'fab' :
'';
} else if (arg.startsWith('.')) {
- classes.push('fa-' + arg.substr(1));
+ classes.push(`fa-${arg.substr(1)}`);
} else if (arg.startsWith('-')) {
transform = arg.substr(1).split('|').join(' ');
} else {
diff --git a/src/remote/activitypub/renderer/hashtag.ts b/src/remote/activitypub/renderer/hashtag.ts
index a37ba63532..36563c2df5 100644
--- a/src/remote/activitypub/renderer/hashtag.ts
+++ b/src/remote/activitypub/renderer/hashtag.ts
@@ -3,5 +3,5 @@ import config from '../../../config';
export default (tag: string) => ({
type: 'Hashtag',
href: `${config.url}/tags/${encodeURIComponent(tag)}`,
- name: '#' + tag
+ name: `#${tag}`
});
diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts
index 1007790ca6..f04f9e91e9 100644
--- a/src/server/activitypub.ts
+++ b/src/server/activitypub.ts
@@ -22,7 +22,7 @@ const router = new Router();
function inbox(ctx: Router.IRouterContext) {
let signature;
- ctx.req.headers.authorization = 'Signature ' + ctx.req.headers.signature;
+ ctx.req.headers.authorization = `Signature ${ctx.req.headers.signature}`;
try {
signature = httpSignature.parseRequest(ctx.req, { 'headers': [] });
diff --git a/src/server/api/endpoints.ts b/src/server/api/endpoints.ts
index d4a44070e6..2b00094269 100644
--- a/src/server/api/endpoints.ts
+++ b/src/server/api/endpoints.ts
@@ -79,7 +79,7 @@ const files = glob.sync('**/*.js', {
});
const endpoints: IEndpoint[] = files.map(f => {
- const ep = require('./endpoints/' + f);
+ const ep = require(`./endpoints/${f}`);
return {
name: f.replace('.js', ''),
diff --git a/src/server/api/stream/notes-stats.ts b/src/server/api/stream/notes-stats.ts
index ab00620018..ba99403226 100644
--- a/src/server/api/stream/notes-stats.ts
+++ b/src/server/api/stream/notes-stats.ts
@@ -16,7 +16,7 @@ export default function(request: websocket.request, connection: websocket.connec
switch (msg.type) {
case 'requestLog':
- ev.once('notesStatsLog:' + msg.id, statsLog => {
+ ev.once(`notesStatsLog:${msg.id}`, statsLog => {
connection.send(JSON.stringify({
type: 'statsLog',
body: statsLog
diff --git a/src/server/api/stream/server-stats.ts b/src/server/api/stream/server-stats.ts
index f6c1f14ebe..d4fbeefa04 100644
--- a/src/server/api/stream/server-stats.ts
+++ b/src/server/api/stream/server-stats.ts
@@ -16,7 +16,7 @@ export default function(request: websocket.request, connection: websocket.connec
switch (msg.type) {
case 'requestLog':
- ev.once('serverStatsLog:' + msg.id, statsLog => {
+ ev.once(`serverStatsLog:${msg.id}`, statsLog => {
connection.send(JSON.stringify({
type: 'statsLog',
body: statsLog
diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts
index 81e5ace3e8..14ccbdd04f 100644
--- a/src/server/web/docs.ts
+++ b/src/server/web/docs.ts
@@ -196,7 +196,7 @@ router.get('/*/api/entities/*', async ctx => {
const lang = ctx.params[0];
const entity = ctx.params[1];
- const x = yaml.safeLoad(fs.readFileSync(path.resolve(__dirname + '/../../../src/docs/api/entities/' + entity + '.yaml'), 'utf-8')) as any;
+ const x = yaml.safeLoad(fs.readFileSync(path.resolve(`${__dirname}/../../../src/docs/api/entities/${entity}.yaml`), 'utf-8')) as any;
await ctx.render('../../../../src/docs/api/entities/view', Object.assign(await genVars(lang), {
id: `api/entities/${entity}`,
diff --git a/src/server/web/views/user.pug b/src/server/web/views/user.pug
index b5ea2f6eb4..98a53ab549 100644
--- a/src/server/web/views/user.pug
+++ b/src/server/web/views/user.pug
@@ -2,7 +2,7 @@ extends ../../../../src/client/app/base
block vars
- const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`;
- - const url = config.url + '/@' + (user.host ? `${user.username}@${user.host}` : user.username);
+ - const url = `${config.url}/@${(user.host ? `${user.username}@${user.host}` : user.username)}`;
- const img = user.avatarId ? `${config.drive_url}/${user.avatarId}` : null;
block title
diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts
index 1da0f49a24..d1c7051ab0 100644
--- a/src/services/drive/add-file.ts
+++ b/src/services/drive/add-file.ts
@@ -40,7 +40,7 @@ async function save(path: string, name: string, type: string, hash: string, size
const thumbnailKey = `${config.drive.prefix}/${uuid.v4()}/${name}.thumbnail.jpg`;
const baseUrl = config.drive.baseUrl
- || `${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? ':' + config.drive.config.port : '' }/${ config.drive.bucket }`;
+ || `${ config.drive.config.useSSL ? 'https' : 'http' }://${ config.drive.config.endPoint }${ config.drive.config.port ? `:${config.drive.config.port}` : '' }/${ config.drive.bucket }`;
await minio.putObject(config.drive.bucket, key, fs.createReadStream(path), size, {
'Content-Type': type,