DEV: Fix typo (#10)

This commit is contained in:
Jarek Radosz 2022-08-13 22:39:58 +02:00 committed by GitHub
parent 1c4f5b1a99
commit ba7ca9e588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -168,7 +168,7 @@ export default {
let diff = 0; let diff = 0;
let replaced = false; let replaced = false;
let newInnnerHTML = elem.innerHTML; let newInnerHTML = elem.innerHTML;
mapping.forEach((m) => { mapping.forEach((m) => {
if ( if (
@ -182,12 +182,12 @@ export default {
replaced = true; replaced = true;
const previousLength = m.length; const previousLength = m.length;
const prefix = newInnnerHTML.slice(0, m.position + diff); const prefix = newInnerHTML.slice(0, m.position + diff);
const suffix = newInnnerHTML.slice( const suffix = newInnerHTML.slice(
m.position + diff + m.length, m.position + diff + m.length,
newInnnerHTML.length newInnerHTML.length
); );
newInnnerHTML = `${prefix}${newValue}${suffix}`; newInnerHTML = `${prefix}${newValue}${suffix}`;
m.length = newValue.length; m.length = newValue.length;
m.position = m.position + diff; m.position = m.position + diff;
@ -195,7 +195,7 @@ export default {
}); });
if (replaced) { if (replaced) {
elem.innerHTML = newInnnerHTML; elem.innerHTML = newInnerHTML;
} }
}); });
}; };