Use startsWith and endsWith for readability

This commit is contained in:
Aya Morisawa 2018-08-25 22:42:26 +09:00
parent bf7875bfaa
commit 08a59591ae
No known key found for this signature in database
GPG key ID: 3E64865D70D579F2
7 changed files with 8 additions and 8 deletions

View file

@ -8,7 +8,7 @@ export const replacement = (ctx: any, _: any, key: string) => {
const client = '/src/client/app/';
let name = null;
if (key[0] == '@') {
if (key.startsWith('@')) {
name = ctx.src.substr(ctx.src.indexOf(client) + client.length);
key = key.substr(1);
}