Skip to content

Commit

Permalink
fix: makeSearchRegex Memory leak (due to empty capture)
Browse files Browse the repository at this point in the history
  • Loading branch information
atk committed Sep 4, 2024
1 parent c7256a9 commit 7865769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/marker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function makeSearchRegex(search: string): RegExp {
return search
? new RegExp(
// join words `|` to match any of them
search.replace(SPLIT_WORDS_REGEX, "|"),
search.trim().replace(SPLIT_WORDS_REGEX, "|"),
"gi",
)
: NEVER_REGEX;
Expand Down

0 comments on commit 7865769

Please sign in to comment.