Updating the regex to correctly find within the filter keys.
This commit is contained in:
parent
28d0d627ce
commit
337584f5b2
|
@ -29,10 +29,8 @@ export function updateFilterKeys(
|
|||
filters: SearchFilters,
|
||||
updates: { original: string; updated: string }[]
|
||||
): SearchFilters {
|
||||
// sort the updates by length first - this is necessary to avoid replacing sub-strings
|
||||
updates = updates.sort((a, b) => b.original.length - a.original.length)
|
||||
const makeFilterKeyRegex = (str: string) =>
|
||||
new RegExp(`^${str}.|:${str}.`, "g")
|
||||
new RegExp(`^${str}\\.|:${str}\\.`)
|
||||
for (let filter of Object.values(filters)) {
|
||||
if (typeof filter !== "object") {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue