Skip to content

Commit a9de61f

Browse files
authored
refactor: resolve sonar feedback on regex patterns (#1825)
refactor: sonar regex tweaks Signed-off-by: Adam Setch <[email protected]>
1 parent 863fcac commit a9de61f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/renderer/utils/api/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ export function getNextURLFromLinkHeader(
2828
response: AxiosResponse,
2929
): string | null {
3030
const linkHeader = response.headers.link;
31-
const matches = linkHeader?.match(/<([^>]+)>;\s*rel="next"/);
31+
const matches = linkHeader?.match(/<([^<>]+)>;\s*rel="next"/);
3232
return matches ? matches[1] : null;
3333
}

src/renderer/utils/subject.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ export function parseLinkedIssuesFromPr(pr: PullRequest): string[] {
338338
return linkedIssues;
339339
}
340340

341-
const regexPattern = /\s*#(\d+)\s*/gi;
342-
341+
const regexPattern = /\s?#(\d+)\s?/gi;
343342
const matches = pr.body.matchAll(regexPattern);
344343

345344
for (const match of matches) {

0 commit comments

Comments
 (0)