Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

perf: only create regex once #49

Merged
merged 7 commits into from
May 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "reset last index"
This reverts commit 0078ce6.
  • Loading branch information
gtm-nayan committed May 27, 2023
commit c16c6bcf00e1bd76f3adfe1177dbb1eb243af140
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,5 @@ export default function stripAnsi(string) {
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
}

regex.lastIndex = 0;
return string.replace(regex, '');
}