Ensure we replace only on when starting with

This commit is contained in:
Adria Navarro 2024-10-15 15:50:52 +02:00
parent 41405ea39d
commit 6688ccf1ab
1 changed files with 6 additions and 2 deletions

View File

@ -53,8 +53,12 @@ export function updateFilterKeys(
)
if (possibleKey && possibleKey.original !== possibleKey.updated) {
// only replace the first, not replaceAll
filter[key.replace(possibleKey.original, possibleKey.updated)] =
filter[key]
filter[
key.replace(
new RegExp(`^${possibleKey.original}\\.`),
`${possibleKey.updated}.`
)
] = filter[key]
delete filter[key]
}
}