@@ -820,6 +820,7 @@ const isStars = (url: URL | HTMLAnchorElement | Location = location): boolean =>
820820 || ( subpath === 'lists' && patharr . length !== 3 )
821821 || ( [ 'repositories' , 'topics' ] . includes ( subpath ) && patharr . length === 3 ) ) ;
822822} ;
823+
823824TEST: addTests ( 'isStars' , [
824825 'https://github.com/stars' ,
825826 'https://github.com/stars/lstn' ,
@@ -830,9 +831,9 @@ TEST: addTests('isStars', [
830831
831832export const isOwnStars = ( url : URL | HTMLAnchorElement | Location = location ) : boolean =>
832833 isStars ( url )
833- && [ [ 'stars' ] , [ 'stars' , getLoggedInUser ( ) ] ] . some (
834- ( needle => arr => arr . length === needle . length
835- && arr . every ( ( v , i ) => v === needle [ i ] ) ) ( getCleanPathname ( url ) . split ( '/' ) . slice ( 0 , 2 ) )
834+ && [ [ 'stars' ] , [ 'stars' , getLoggedInUser ( ) ] ] . some (
835+ ( needle => pathArr => pathArr . length === needle . length
836+ && pathArr . every ( ( v , i ) => v === needle [ i ] ) ) ( getCleanPathname ( url ) . split ( '/' ) . slice ( 0 , 2 ) )
836837 ) ;
837838
838839export const isStarsList = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isStars ( url ) && getCleanPathname ( url ) . split ( '/' ) [ 2 ] === 'lists' ;
@@ -842,7 +843,6 @@ TEST: addTests('isStarsList', [
842843
843844export const isOwnStarsList = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isOwnStars ( url ) && getCleanPathname ( url ) . split ( '/' ) [ 2 ] === 'lists' ;
844845
845-
846846export const isUserTheOrganizationOwner = ( ) : boolean => isOrganizationProfile ( ) && exists ( '[aria-label="Organization"] [data-tab-item="org-header-settings-tab"]' ) ;
847847
848848export const canUserAdminRepo = ( ) : boolean => isRepo ( ) && exists ( '.reponav-item[href$="/settings"], [data-tab-item$="settings-tab"]' ) ;
0 commit comments