Skip to content

Commit

Permalink
Ensure is[Status]PR only matches PRs and not issues (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jul 24, 2022
1 parent 2d1f30e commit 1663cd9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,11 @@ addTests('isQuickPR', [
'https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1',
]);

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

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

0 comments on commit 1663cd9

Please sign in to comment.