Skip to content

Commit

Permalink
Add isRepoNetworkGraph and isRepoForksList (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
payne911 committed Feb 10, 2021
1 parent f8b8d8e commit 1fe20d2
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 @@ -386,6 +386,16 @@ collect.set('isFileFinder', [
'https://github.com/sindresorhus/refined-github/find/master',
]);

export const isRepoForksList = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'network/members';
collect.set('isRepoForksList', [
'https://github.com/sindresorhus/refined-github/network/members',
]);

export const isRepoNetworkGraph = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'network';
collect.set('isRepoNetworkGraph', [
'https://github.com/sindresorhus/refined-github/network',
]);

export const isForkedRepo = (): boolean => exists('meta[name="octolytics-dimension-repository_is_fork"][content="true"]');

export const isSingleGist = (url: URL | HTMLAnchorElement | Location = location): boolean => isGist(url) && /^\/(gist\/)?[^/]+\/[\da-f]{32}$/.test(url.pathname);
Expand Down

0 comments on commit 1fe20d2

Please sign in to comment.