@@ -56,10 +56,13 @@ collect.set('isCompare', [
56
56
57
57
export const isDashboard = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => ! isGist ( url ) && / ^ $ | ^ ( o r g s \/ [ ^ / ] + \/ ) ? d a s h b o a r d ( \/ | $ ) / . test ( getCleanPathname ( url ) ) ;
58
58
collect . set ( 'isDashboard' , [
59
+ 'https://github.com///' ,
60
+ 'https://github.com//' ,
59
61
'https://github.com/' ,
60
62
'https://github.com' ,
61
63
'https://github.com/orgs/test/dashboard' ,
62
64
'https://github.com/dashboard/index/2' ,
65
+ 'https://github.com//dashboard' ,
63
66
'https://github.com/dashboard' ,
64
67
'https://github.com/orgs/edit/dashboard' ,
65
68
'https://github.big-corp.com/' ,
@@ -372,6 +375,7 @@ collect.set('isRepoHome', [
372
375
'https://github.com/sindresorhus/refined-github/' ,
373
376
'https://github.com/sindresorhus/notifications/' ,
374
377
'https://github.com/sindresorhus/edit' ,
378
+ 'https://github.com/sindresorhus///edit' ,
375
379
'https://github.com/sindresorhus/search' ,
376
380
'https://github.com/sindresorhus/branches' ,
377
381
'https://github.com/sindresorhus/refined-github?files=1' ,
@@ -641,8 +645,8 @@ collect.set('isNewRepoTemplate', [
641
645
/** Get the logged-in user’s username */
642
646
const getUsername = ( ) : string | undefined => document . querySelector ( 'meta[name="user-login"]' ) ?. getAttribute ( 'content' ) ! ;
643
647
644
- /** Drop leading and trailing slashes */
645
- const getCleanPathname = ( url : URL | HTMLAnchorElement | Location = location ) : string => url . pathname . slice ( 1 , url . pathname . endsWith ( '/' ) ? - 1 : undefined ) ;
648
+ /** Drop all duplicate slashes */
649
+ const getCleanPathname = ( url : URL | HTMLAnchorElement | Location = location ) : string => url . pathname . replace ( / \/ + / g , '/' ) . slice ( 1 , url . pathname . endsWith ( '/' ) ? - 1 : undefined ) ;
646
650
647
651
export interface RepositoryInfo {
648
652
owner : string ;
0 commit comments