@@ -58,6 +58,9 @@ collect.set('isDashboard', [
58
58
'https://not-github.com/' ,
59
59
'https://my-little-hub.com/' ,
60
60
'https://github.com/?tab=repositories' , // Gotcha for `isUserProfileRepoTab`
61
+ 'https://github.com/?tab=stars' , // Gotcha for `isUserProfileStarsTab`
62
+ 'https://github.com/?tab=followers' , // Gotcha for `isUserProfileFollowersTab`
63
+ 'https://github.com/?tab=following' , // Gotcha for `isUserProfileFollowingTab`
61
64
] ) ;
62
65
63
66
export const isEnterprise = ( url : URL | Location = location ) : boolean => url . hostname !== 'github.com' && url . hostname !== 'gist.github.com' ;
@@ -354,10 +357,25 @@ collect.set('isBranches', [
354
357
355
358
export const isUserProfile = ( ) : boolean => exists ( '.user-profile-nav' ) ;
356
359
360
+ export const isUserProfileMainTab = ( ) : boolean =>
361
+ isUserProfile ( ) && ! new URLSearchParams ( location . search ) . get ( 'tab' ) ;
362
+
357
363
export const isUserProfileRepoTab = ( ) : boolean =>
358
364
isUserProfile ( ) &&
359
365
new URLSearchParams ( location . search ) . get ( 'tab' ) === 'repositories' ;
360
366
367
+ export const isUserProfileStarsTab = ( ) : boolean =>
368
+ isUserProfile ( ) &&
369
+ new URLSearchParams ( location . search ) . get ( 'tab' ) === 'stars' ;
370
+
371
+ export const isUserProfileFollowersTab = ( ) : boolean =>
372
+ isUserProfile ( ) &&
373
+ new URLSearchParams ( location . search ) . get ( 'tab' ) === 'followers' ;
374
+
375
+ export const isUserProfileFollowingTab = ( ) : boolean =>
376
+ isUserProfile ( ) &&
377
+ new URLSearchParams ( location . search ) . get ( 'tab' ) === 'following' ;
378
+
361
379
export const isSingleTagPage = ( url : URL | Location = location ) : boolean => / ^ ( r e l e a s e s \/ t a g ) / . test ( getRepoPath ( url ) ! ) ;
362
380
collect . set ( 'isSingleTagPage' , [
363
381
'https://github.com/sindresorhus/refined-github/releases/tag/v1.0.0-beta.4' ,
0 commit comments