Skip to content

Commit 1663cd9

Browse files
authored
Ensure is[Status]PR only matches PRs and not issues (#136)
1 parent 2d1f30e commit 1663cd9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,11 @@ addTests('isQuickPR', [
264264
'https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1',
265265
]);
266266

267-
export const isDraftPR = (): boolean => exists('#partial-discussion-header [title="Status: Draft"]');
268-
export const isOpenPR = (): boolean => exists('#partial-discussion-header [title="Status: Open"], #partial-discussion-header [title="Status: Draft"]');
269-
export const isMergedPR = (): boolean => exists('#partial-discussion-header [title="Status: Merged"]');
270-
export const isClosedConversation = (): boolean => exists('#partial-discussion-header :is([title="Status: Closed"], [title="Status: Merged"], [title="Status: Closed as not planned"])');
271-
/** @deprecated Use isClosedConversation */
272-
export const isClosedPR = isClosedConversation;
267+
export const isDraftPR = (): boolean => exists('#partial-discussion-header .octicon-git-pull-request-draft');
268+
export const isOpenPR = (): boolean => exists('#partial-discussion-header :is(.octicon-git-pull-request, .octicon-git-pull-request-draft)');
269+
export const isMergedPR = (): boolean => exists('#partial-discussion-header .octicon-git-merge');
270+
export const isClosedPR = (): boolean => exists('#partial-discussion-header :is(.octicon-git-pull-request-closed, .octicon-git-merge)');
271+
export const isClosedIssue = (): boolean => exists('#partial-discussion-header :is(.octicon-issue-closed, .octicon-skip)');
273272

274273
export const isReleases = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'releases';
275274
addTests('isReleases', [

0 commit comments

Comments
 (0)