prefer const when not reasigned

This commit is contained in:
Joffrey JAFFEUX 2017-06-05 14:33:52 +02:00
parent 64336a8c75
commit f8e5cbd81a
2 changed files with 3 additions and 3 deletions

View File

@ -338,7 +338,7 @@ export default Ember.Component.extend({
},
onKeyUp(text, cp) {
var subtext = text.substring(0, cp);
const subtext = text.substring(0, cp);
return subtext.match(/(:(?!:).?[\w-]*:?(?!:)(?:t\d?)?:?) ?$/gm);
},
@ -377,7 +377,7 @@ export default Ember.Component.extend({
return resolve([translations[full]]);
}
let match = term.match(/^:?(.*?):t(\d)?$/);
const match = term.match(/^:?(.*?):t(\d)?$/);
if (match) {
let name = match[1];
let scale = match[2];

View File

@ -64,7 +64,7 @@ export function buildEmojiUrl(code, opts) {
url = opts.customEmoji[code];
}
let noToneMatch = code.match(/(.?[\w-]*)?:?/);
const noToneMatch = code.match(/(.?[\w-]*)?:?/);
if (noToneMatch && !url && (emojiHash.hasOwnProperty(noToneMatch[1]) || aliasHash.hasOwnProperty(noToneMatch[1]))) {
url = opts.getURL(`/images/emoji/${opts.emojiSet}/${code.replace(/:t/, '/')}.png`);
}