diff --git a/index.ts b/index.ts index 04f94a5..270c4f1 100644 --- a/index.ts +++ b/index.ts @@ -865,6 +865,9 @@ TEST: addTests('isRepositoryActions', [ export const isUserTheOrganizationOwner = (): boolean => isOrganizationProfile() && exists('[aria-label="Organization"] [data-tab-item="org-header-settings-tab"]'); +/** + * @deprecated Use canUserAccessRepoSettings or API instead. + */ export const canUserAdminRepo = (): boolean => { const repo = getRepo(); return Boolean(repo && exists(`:is(${[ @@ -874,6 +877,9 @@ export const canUserAdminRepo = (): boolean => { ].join(',')}) a[href="/${repo.nameWithOwner}/settings"]`)); }; +// eslint-disable-next-line @typescript-eslint/no-deprecated +export const canUserAccessRepoSettings = canUserAdminRepo; + export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && (url.pathname === '/new' || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url))); TEST: addTests('isNewRepo', [ 'https://github.com/new',