Skip to content

Commit 73e3e49

Browse files
Rename canUserAdminRepo to canUserAccessRepoSettings (#241)
1 parent abed969 commit 73e3e49

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,9 @@ TEST: addTests('isRepositoryActions', [
892892

893893
export const isUserTheOrganizationOwner = (): boolean => isOrganizationProfile() && exists('[aria-label="Organization"] [data-tab-item="org-header-settings-tab"]');
894894

895+
/**
896+
* @deprecated Use canUserAccessRepoSettings or API instead.
897+
*/
895898
export const canUserAdminRepo = (): boolean => {
896899
const repo = getRepo();
897900
return Boolean(repo && exists(`:is(${[
@@ -901,6 +904,9 @@ export const canUserAdminRepo = (): boolean => {
901904
].join(',')}) a[href="/${repo.nameWithOwner}/settings"]`));
902905
};
903906

907+
// eslint-disable-next-line @typescript-eslint/no-deprecated
908+
export const canUserAccessRepoSettings = canUserAdminRepo;
909+
904910
export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && (url.pathname === '/new' || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url)));
905911
TEST: addTests('isNewRepo', [
906912
'https://github.com/new',

0 commit comments

Comments
 (0)