fix: prevent duplicate path keys in entity search by ignoring case
Signed-off-by: Kuldeep Parihar <kldpsingh916@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Added a fix in `@backstage/plugin-catalog-backend` to prevent duplicate path keys in entity search if only casing is different.
|
||||
@@ -110,7 +110,16 @@ export function traverse(root: unknown): Kv[] {
|
||||
// because the latter means EITHER b or c has to be present.
|
||||
visit(path, item);
|
||||
if (typeof item === 'string') {
|
||||
output.push({ key: `${path}.${item}`, value: true });
|
||||
const pathKey = `${path}.${item}`;
|
||||
if (
|
||||
!output.some(
|
||||
kv =>
|
||||
kv.key.toLocaleLowerCase('en-US') ===
|
||||
pathKey.toLocaleLowerCase('en-US'),
|
||||
)
|
||||
) {
|
||||
output.push({ key: pathKey, value: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user