From 342a41d17dc238d46fcb2ce7e6afa4f5655e563d Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Fri, 9 May 2025 11:31:20 +0800 Subject: [PATCH] Fix `isProject` --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 7f7f057..45da1ad 100644 --- a/index.ts +++ b/index.ts @@ -202,9 +202,10 @@ export const isOwnUserProfile = (): boolean => getCleanPathname() === getLoggedI // If there's a Report Abuse link, we're not part of the org export const isOwnOrganizationProfile = (): boolean => isOrganizationProfile() && !exists('[href*="contact/report-abuse?report="]'); -export const isProject = (url: URL | HTMLAnchorElement | Location = location): boolean => /^projects\/\d+/.test(getRepo(url)?.path); +export const isProject = (url: URL | HTMLAnchorElement | Location = location): boolean => /^projects\/\d+/.test(getRepo(url)?.path ?? getOrg(url)?.path); TEST: addTests('isProject', [ 'https://github.com/sindresorhus/refined-github/projects/3', + 'https://github.com/orgs/RSSNext/projects/3', ]); export const isProjects = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'projects';