Use startsWith and endsWith for readability
This commit is contained in:
parent
bf7875bfaa
commit
08a59591ae
7 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue