Skip to content

Commit

Permalink
Add isOrganizationRepo (#60)
Browse files Browse the repository at this point in the history
Co-authored-by: Federico <me@fregante.com>
  • Loading branch information
yakov116 and fregante committed Feb 18, 2021
1 parent 68b74c1 commit 77bff52
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ collect.set('isNotifications', [

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

export const isOrganizationRepo = (): boolean => Boolean(document.querySelector<HTMLElement>('[data-owner-scoped-search-url]')?.dataset.ownerScopedSearchUrl!.startsWith('/org'));

export const isOrganizationDiscussion = (url: URL | HTMLAnchorElement | Location = location): boolean => /^orgs\/[^/]+\/teams\/[^/]+($|\/discussions)/.test(getCleanPathname(url));
collect.set('isOrganizationDiscussion', [
'https://github.com/orgs/refined-github/teams/core-team/discussions?pinned=1',
Expand Down

0 comments on commit 77bff52

Please sign in to comment.