Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tugrul committed May 2, 2024
1 parent 6d4159c commit 69d0598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function replace(str: string, regex: RegExp, callback: ReplaceCallb
const [target, ...groups] = match;

parts.push(callback(target, groups, match.index, match.input));
last = match.index + match[0].length;
last = match.index + target.length;

if (size > 0 && --size === 0) {
size = limit
Expand Down

0 comments on commit 69d0598

Please sign in to comment.