Skip to content

Commit 00609a9

Browse files
committed
chore: fix typos
1 parent 9d63cbc commit 00609a9

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/ReplaceSource.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class ReplaceSource extends Source {
201201
const replacements = this._replacements;
202202
let pos = 0;
203203
let i = 0;
204-
let replacmentEnd = -1;
204+
let replacementEnd = -1;
205205
let nextReplacement =
206206
i < replacements.length
207207
? Math.floor(replacements[i].start)
@@ -257,9 +257,9 @@ class ReplaceSource extends Source {
257257
let endPos = pos + chunk.length;
258258

259259
// Skip over when it has been replaced
260-
if (replacmentEnd > pos) {
260+
if (replacementEnd > pos) {
261261
// Skip over the whole chunk
262-
if (replacmentEnd >= endPos) {
262+
if (replacementEnd >= endPos) {
263263
const line = generatedLine + generatedLineOffset;
264264
if (chunk.endsWith("\n")) {
265265
generatedLineOffset--;
@@ -278,7 +278,7 @@ class ReplaceSource extends Source {
278278
}
279279

280280
// Partially skip over chunk
281-
chunkPos = replacmentEnd - pos;
281+
chunkPos = replacementEnd - pos;
282282
if (
283283
checkOriginalContent(
284284
sourceIndex,
@@ -384,23 +384,23 @@ class ReplaceSource extends Source {
384384
}
385385

386386
// Remove replaced content by settings this variable
387-
replacmentEnd = Math.max(
388-
replacmentEnd,
387+
replacementEnd = Math.max(
388+
replacementEnd,
389389
Math.floor(replacements[i].end + 1)
390390
);
391391

392-
// Move to next replacment
392+
// Move to next replacement
393393
i++;
394394
nextReplacement =
395395
i < replacements.length
396396
? Math.floor(replacements[i].start)
397397
: MAX_SOURCE_POSITION;
398398

399399
// Skip over when it has been replaced
400-
const offset = chunk.length - endPos + replacmentEnd - chunkPos;
400+
const offset = chunk.length - endPos + replacementEnd - chunkPos;
401401
if (offset > 0) {
402402
// Skip over whole chunk
403-
if (replacmentEnd >= endPos) {
403+
if (replacementEnd >= endPos) {
404404
let line = generatedLine + generatedLineOffset;
405405
if (chunk.endsWith("\n")) {
406406
generatedLineOffset--;

lib/helpers/createMappingsSerializer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const createFullMappingsSerializer = () => {
6868
} else {
6969
// No mapping is active
7070
if (sourceIndex < 0) {
71-
// avoid writing unneccessary generated mappings
71+
// avoid writing unnecessary generated mappings
7272
return "";
7373
}
7474
}

test/ReplaceSource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export default function StaticPage(_ref) {
283283
`);
284284
});
285285

286-
it("should not generate invalid mappings when replacing mulitple lines of code", () => {
286+
it("should not generate invalid mappings when replacing multiple lines of code", () => {
287287
const source = new ReplaceSource(
288288
new OriginalSource(
289289
["if (a;b;c) {", " a; b; c;", "}"].join("\n"),

0 commit comments

Comments
 (0)