Skip to content

Commit 73fdb07

Browse files
committed
Add isForkingRepo
1 parent 278a6d2 commit 73fdb07

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
@@ -567,6 +567,11 @@ TEST: addTests('isRepoNetworkGraph', [
567567

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

570+
export const isForkingRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'fork';
571+
TEST: addTests('isForkingRepo', [
572+
'https://github.com/refined-github/refined-github/fork',
573+
]);
574+
570575
export const isSingleGist = (url: URL | HTMLAnchorElement | Location = location): boolean => /^[^/]+\/[\da-f]{20,32}(\/[\da-f]{40})?$/.test(getCleanGistPathname(url));
571576
TEST: addTests('isSingleGist', [
572577
'https://gist.github.com/fregante/2205329b71218fa2c1d3',

0 commit comments

Comments
 (0)