Skip to content

Commit 002d16e

Browse files
authored
Add isDraftPR isOpenPR isMergedPR isClosedPR (#62)
1 parent f4a4174 commit 002d16e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ collect.set('isQuickPR', [
229229
'https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1',
230230
]);
231231

232+
export const isDraftPR = (): boolean => exists('#partial-discussion-header [title="Status: Draft"]');
233+
export const isOpenPR = (): boolean => exists('#partial-discussion-header [title="Status: Open"], #partial-discussion-header [title="Status: Draft"]');
234+
export const isMergedPR = (): boolean => exists('#partial-discussion-header [title="Status: Merged"]');
235+
export const isClosedPR = (): boolean => exists('#partial-discussion-header [title="Status: Closed"], #partial-discussion-header [title="Status: Merged"]');
236+
232237
export const isReleasesOrTags = (url: URL | HTMLAnchorElement | Location = location): boolean => /^tags$|^releases($|\/tag)/.test(getRepo(url)?.path!);
233238
collect.set('isReleasesOrTags', [
234239
'https://github.com/sindresorhus/refined-github/releases',

0 commit comments

Comments
 (0)