Skip to content

Commit 78a01f9

Browse files
authored
Add isFork (#209)
1 parent abee5e1 commit 78a01f9

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

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

617+
export const isFork = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'fork';
618+
TEST: addTests('isFork', [
619+
'https://github.com/refined-github/refined-github/fork',
620+
]);
621+
617622
export const isSingleGist = (url: URL | HTMLAnchorElement | Location = location): boolean => /^[^/]+\/[\da-f]{20,32}(\/[\da-f]{40})?$/.test(getCleanGistPathname(url));
618623
TEST: addTests('isSingleGist', [
619624
'https://gist.github.com/fregante/2205329b71218fa2c1d3',

0 commit comments

Comments
 (0)