Skip to content

Commit

Permalink
Switch String.replaceAll to replace for browser support. (#746)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolkamps1 committed Apr 17, 2024
1 parent 1fb9a61 commit d670187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/aggregators/searchAggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports.createRegexForProjectLookupAggr = function (keywords, caseSensitive, fuz
if (keywords) {
keywords = keywords.replace(/"/g, "").trim();
let keywordSearch = fuzzy && !keywords.startsWith("\"") && !keywords.endsWith("\"") ? fuzzySearch.createFuzzySearchString(keywords, 4, caseSensitive) : "\"" + keywords + "\"";
const regexKeyword = `.*${keywordSearch.replaceAll(/"/g, "").trim()}.*`,
const regexKeyword = `.*${keywordSearch.replace(/"/g, "").trim()}.*`,
keywordModifier = {
"project.name": {
"$regex": regexKeyword,
Expand Down

0 comments on commit d670187

Please sign in to comment.