This commit is contained in:
Adria Navarro 2024-10-15 16:30:10 +02:00
parent 6688ccf1ab
commit 225d062fcc
1 changed files with 4 additions and 3 deletions

View File

@ -44,10 +44,11 @@ export function updateFilterKeys(
if (!isPlainObject(filter)) { if (!isPlainObject(filter)) {
continue continue
} }
for (let [key, keyFilter] of Object.entries(filter)) { for (const [key, keyFilter] of Object.entries(filter)) {
if (keyFilter === "") { if (keyFilter === "") {
delete filter[key] delete filter[key]
} }
const possibleKey = updates.find(({ original }) => const possibleKey = updates.find(({ original }) =>
key.match(makeFilterKeyRegex(original)) key.match(makeFilterKeyRegex(original))
) )
@ -55,8 +56,8 @@ export function updateFilterKeys(
// only replace the first, not replaceAll // only replace the first, not replaceAll
filter[ filter[
key.replace( key.replace(
new RegExp(`^${possibleKey.original}\\.`), new RegExp(`^(\\d+:)?${possibleKey.original}\\.`),
`${possibleKey.updated}.` `$1${possibleKey.updated}.`
) )
] = filter[key] ] = filter[key]
delete filter[key] delete filter[key]