From 73fdb07e276d3e45c794d48524a21efa5a22fa42 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Wed, 18 Jun 2025 11:08:37 +0800 Subject: [PATCH 1/2] Add `isForkingRepo` --- index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.ts b/index.ts index 7f7f057..a3b434e 100644 --- a/index.ts +++ b/index.ts @@ -567,6 +567,11 @@ TEST: addTests('isRepoNetworkGraph', [ export const isForkedRepo = (): boolean => exists('meta[name="octolytics-dimension-repository_is_fork"][content="true"]'); +export const isForkingRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'fork'; +TEST: addTests('isForkingRepo', [ + 'https://github.com/refined-github/refined-github/fork', +]); + export const isSingleGist = (url: URL | HTMLAnchorElement | Location = location): boolean => /^[^/]+\/[\da-f]{20,32}(\/[\da-f]{40})?$/.test(getCleanGistPathname(url)); TEST: addTests('isSingleGist', [ 'https://gist.github.com/fregante/2205329b71218fa2c1d3', From 70cf49f6044668cfca4348f566591fcf910ac5f9 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Wed, 18 Jun 2025 11:10:59 +0800 Subject: [PATCH 2/2] update --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index a3b434e..727baba 100644 --- a/index.ts +++ b/index.ts @@ -567,8 +567,8 @@ TEST: addTests('isRepoNetworkGraph', [ export const isForkedRepo = (): boolean => exists('meta[name="octolytics-dimension-repository_is_fork"][content="true"]'); -export const isForkingRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'fork'; -TEST: addTests('isForkingRepo', [ +export const isFork = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'fork'; +TEST: addTests('isFork', [ 'https://github.com/refined-github/refined-github/fork', ]);