chore: modernize

This commit is contained in:
Jamie Peabody
2021-12-30 08:48:22 +00:00
parent e0ef4cb9c4
commit f8e07526f6

View File

@@ -264,9 +264,8 @@ CodeifyText.prototype._diff_ctx = function(lines) {
}
CodeifyText.prototype._codeify = function(lines, ctx) {
var code = this._max_code;
for (var i = 0; i < lines.length; ++i) {
var line = lines[i];
for (let i = 0; i < lines.length; ++i) {
let line = lines[i];
if (this.options.ignorews) {
line = line.replace(/\s+/g, '');
}
@@ -276,12 +275,11 @@ CodeifyText.prototype._codeify = function(lines, ctx) {
if (this.options.ignoreaccents) {
line = line.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
}
var aCode = this._diff_codes[line];
if (aCode != undefined) {
const aCode = this._diff_codes[line];
if (aCode !== undefined) {
ctx.codes[i] = aCode;
}
else {
this._max_code++;
} else {
++this._max_code;
this._diff_codes[line] = this._max_code;
ctx.codes[i] = this._max_code;
}