Skip to content

Commit

Permalink
fix: makeSearchRegex Memory leak (due to empty capture) (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
atk authored Sep 4, 2024
2 parents c7256a9 + a1f602d commit b4eada7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/selfish-eagles-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solid-primitives/marker": minor
---

fix memory leak
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 b4eada7

Please sign in to comment.