Skip to content

Commit 77bff52

Browse files
yakov116fregante
andauthored
Add isOrganizationRepo (#60)
Co-authored-by: Federico <me@fregante.com>
1 parent 68b74c1 commit 77bff52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ collect.set('isNotifications', [
144144

145145
export const isOrganizationProfile = (): boolean => exists('meta[name="hovercard-subject-tag"][content^="organization"]');
146146

147+
export const isOrganizationRepo = (): boolean => Boolean(document.querySelector<HTMLElement>('[data-owner-scoped-search-url]')?.dataset.ownerScopedSearchUrl!.startsWith('/org'));
148+
147149
export const isOrganizationDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^orgs\/[^/]+\/teams\/[^/]+($|\/discussions)/.test(getCleanPathname(url));
148150
collect.set('isOrganizationDiscussion', [
149151
'https://github.com/orgs/refined-github/teams/core-team/discussions?pinned=1',

0 commit comments

Comments
 (0)