Skip to content

Commit f475ae0

Browse files
committed
fix(ui): fix unused capturing group in entity type regex
- Convert capturing group to non-capturing group in pathBasedPattern - Resolves regexp/no-unused-capturing-group violation
1 parent b411302 commit f475ae0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ui/src/components/entity-views/matchers/entity-matchers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const convertToRelativeUrl = (urlOrId: string): string => {
6666

6767
// If the ID already includes an entity type path (e.g., "topics/T10211", "keywords/machine-learning"),
6868
// return it directly
69-
const pathBasedPattern = /^(works|authors|sources|institutions|topics|publishers|funders|concepts|fields|domains|subfields|keywords)\//i;
69+
const pathBasedPattern = /^(?:works|authors|sources|institutions|topics|publishers|funders|concepts|fields|domains|subfields|keywords)\//i;
7070
if (pathBasedPattern.test(id)) {
7171
return `#/${id}`;
7272
}

0 commit comments

Comments
 (0)