Skip to content

Commit

Permalink
Add isDiscussionList and isDiscussion (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakov116 committed Feb 14, 2021
1 parent 3ab0efa commit c872099
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ collect.set('isProject', [
'https://github.com/sindresorhus/refined-github/projects/3',
]);

export const isDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^discussions\/\d+/.test(getRepo(url)?.path!);
collect.set('isDiscussion', [
'https://github.com/tophf/mpiv/discussions/50',
]);

export const isDiscussionList = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'discussions';
collect.set('isDiscussionList', [
'https://github.com/tophf/mpiv/discussions',
]);

export const isPR = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+/.test(getRepo(url)?.path!) && !isPRConflicts(url);
collect.set('isPR', [
'https://github.com/sindresorhus/refined-github/pull/148',
Expand Down

0 comments on commit c872099

Please sign in to comment.