Skip to content

Commit c872099

Browse files
authored
Add isDiscussionList and isDiscussion (#59)
1 parent 3ab0efa commit c872099

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,16 @@ collect.set('isProject', [
161161
'https://github.com/sindresorhus/refined-github/projects/3',
162162
]);
163163

164+
export const isDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^discussions\/\d+/.test(getRepo(url)?.path!);
165+
collect.set('isDiscussion', [
166+
'https://github.com/tophf/mpiv/discussions/50',
167+
]);
168+
169+
export const isDiscussionList = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'discussions';
170+
collect.set('isDiscussionList', [
171+
'https://github.com/tophf/mpiv/discussions',
172+
]);
173+
164174
export const isPR = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+/.test(getRepo(url)?.path!) && !isPRConflicts(url);
165175
collect.set('isPR', [
166176
'https://github.com/sindresorhus/refined-github/pull/148',

0 commit comments

Comments
 (0)