Merge branch 'string-interpolation' into develop

This commit is contained in:
Aya Morisawa 2018-09-01 23:30:16 +09:00
commit 5e0f5c31e7
No known key found for this signature in database
GPG key ID: 3E64865D70D579F2
40 changed files with 53 additions and 53 deletions

View file

@ -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': [] });

View file

@ -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', ''),

View file

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

View file

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

View file

@ -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}`,

View file

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