Skip to content

Commit

Permalink
Fix use of invalid variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mikogs committed Oct 30, 2023
1 parent c321c36 commit 7036741
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions replace-string/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30036,7 +30036,7 @@ try {
}

const inReplaceRegexArr = inReplaceRegex.split(/\n/);
const inReplaceWithArr = inReplaceRegex.split(/\n/);
const inReplaceWithArr = inReplaceWith.split(/\n/);

console.log(inReplaceRegexArr);
console.log(inReplaceWithArr);
Expand Down Expand Up @@ -30066,7 +30066,7 @@ try {
if (inReplaceRegexArr.length > 1) {
for (i=0; i<inReplaceRegexArr.length; i++) {
const regex = new RegExp(inReplaceRegexArr[0], inFlags);
strReplaced = strToReplace.replace(regex, inReplaceWith[i]);
strReplaced = strToReplace.replace(regex, inReplaceWithArr[i]);
}
} else {
const regex = new RegExp(inReplaceRegex, inFlags);
Expand Down
4 changes: 2 additions & 2 deletions replace-string/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ try {
}

const inReplaceRegexArr = inReplaceRegex.split(/\n/);
const inReplaceWithArr = inReplaceRegex.split(/\n/);
const inReplaceWithArr = inReplaceWith.split(/\n/);

console.log(inReplaceRegexArr);
console.log(inReplaceWithArr);
Expand Down Expand Up @@ -54,7 +54,7 @@ try {
if (inReplaceRegexArr.length > 1) {
for (i=0; i<inReplaceRegexArr.length; i++) {
const regex = new RegExp(inReplaceRegexArr[0], inFlags);
strReplaced = strToReplace.replace(regex, inReplaceWith[i]);
strReplaced = strToReplace.replace(regex, inReplaceWithArr[i]);
}
} else {
const regex = new RegExp(inReplaceRegex, inFlags);
Expand Down

0 comments on commit 7036741

Please sign in to comment.