File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -865,6 +865,9 @@ TEST: addTests('isRepositoryActions', [
865865
866866export const isUserTheOrganizationOwner = ( ) : boolean => isOrganizationProfile ( ) && exists ( '[aria-label="Organization"] [data-tab-item="org-header-settings-tab"]' ) ;
867867
868+ /**
869+ * @deprecated Use doesUserHaveRepoWriteAccess or API instead.
870+ */
868871export const canUserAdminRepo = ( ) : boolean => {
869872 const repo = getRepo ( ) ;
870873 return Boolean ( repo && exists ( `:is(${ [
@@ -874,6 +877,8 @@ export const canUserAdminRepo = (): boolean => {
874877 ] . join ( ',' ) } ) a[href="/${ repo . nameWithOwner } /settings"]`) ) ;
875878} ;
876879
880+ export const doesUserHaveRepoWriteAccess = canUserAdminRepo ;
881+
877882export const isNewRepo = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => ! isGist ( url ) && ( url . pathname === '/new' || / ^ o r g a n i z a t i o n s \/ [ ^ / ] + \/ r e p o s i t o r i e s \/ n e w $ / . test ( getCleanPathname ( url ) ) ) ;
878883TEST: addTests ( 'isNewRepo' , [
879884 'https://github.com/new' ,
You can’t perform that action at this time.
0 commit comments