@@ -287,22 +287,27 @@ collect.set('isRepoIssueList', [
287
287
'https://github.com/sindresorhus/refined-github/issues?q=is%3Aclosed+sort%3Aupdated-desc' ,
288
288
] ) ;
289
289
290
- export const isRepoRoot = ( url : URL | Location = location ) : boolean => / ^ ( t r e e \/ [ ^ / ] + ) ? $ / . test ( getRepoPath ( url ) ! ) ;
291
- collect . set ( 'isRepoRoot ' , [
290
+ export const isRepoHome = ( url : URL | Location = location ) : boolean => getRepoPath ( url ) === '' ;
291
+ collect . set ( 'isRepoHome ' , [
292
292
// Some tests are here only as "gotchas" for other tests that may misidentify their pages
293
- 'https://github.com/sindresorhus/edit' ,
294
- 'https://github.com/sindresorhus/search' ,
295
293
'https://github.com/sindresorhus/refined-github' ,
296
294
'https://github.com/sindresorhus/refined-github/' ,
297
295
'https://github.com/sindresorhus/notifications/' ,
296
+ 'https://github.com/sindresorhus/edit' ,
297
+ 'https://github.com/sindresorhus/search' ,
298
+ 'https://github.com/sindresorhus/branches' ,
299
+ 'https://github.com/sindresorhus/refined-github?files=1' ,
300
+ ] ) ;
301
+
302
+ export const isRepoRoot = ( url : URL | Location = location ) : boolean => / ^ ( t r e e \/ [ ^ / ] + ) ? $ / . test ( getRepoPath ( url ) ! ) ;
303
+ collect . set ( 'isRepoRoot' , [
304
+ ...collect . get ( 'isRepoHome' ) as string [ ] ,
298
305
'https://github.com/sindresorhus/refined-github/tree/native-copy-buttons' ,
299
306
'https://github.com/sindresorhus/refined-github/tree/native-copy-buttons/' ,
300
307
'https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6' ,
301
308
'https://github.com/sindresorhus/refined-github/tree/03fa6b8b4d6e68dea9dc9bee1d197ef5d992fbd6/' ,
302
309
'https://github.com/sindresorhus/refined-github/tree/57bf4' ,
303
- 'https://github.com/sindresorhus/refined-github?files=1' ,
304
310
'https://github.com/sindresorhus/refined-github/tree/master?files=1' ,
305
- 'https://github.com/sindresorhus/branches' ,
306
311
] ) ;
307
312
308
313
// This can't use `getRepoPath` to avoid infinite recursion.
0 commit comments