@@ -28,8 +28,7 @@ export const isCommit = (url: URL | HTMLAnchorElement | Location = location): bo
28
28
addTests ( 'isCommit' , [
29
29
'https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f' ,
30
30
'https://github.com/sindresorhus/refined-github/commit/5b614' ,
31
- 'https://github.com/sindresorhus/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85' ,
32
- 'https://github.com/sindresorhus/refined-github/pull/148/commits/00196' ,
31
+ 'isPRCommit' ,
33
32
] ) ;
34
33
35
34
export const isCommitList = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isRepoCommitList ( url ) || isPRCommitList ( url ) ;
@@ -229,11 +228,9 @@ addTests('isDiscussionList', [
229
228
230
229
export const isPR = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + / . test ( getRepo ( url ) ?. path ! ) && ! isPRConflicts ( url ) ;
231
230
addTests ( 'isPR' , [
231
+ 'isPRFiles' ,
232
+ 'isPRCommitList' ,
232
233
'https://github.com/sindresorhus/refined-github/pull/148' ,
233
- 'https://github.com/sindresorhus/refined-github/pull/148/commits' ,
234
- 'https://github.com/sindresorhus/refined-github/pull/148/files' ,
235
- 'https://github.com/sindresorhus/refined-github/pull/148/commits/00196' ,
236
- 'https://github.com/sindresorhus/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85' ,
237
234
] ) ;
238
235
239
236
export const isPRConflicts = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + \/ c o n f l i c t s / . test ( getRepo ( url ) ?. path ! ) ;
@@ -271,9 +268,12 @@ addTests('isPRCommitList', [
271
268
'https://github.com/sindresorhus/refined-github/pull/148/commits' ,
272
269
] ) ;
273
270
274
- export const isPRFiles = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + \/ f i l e s / . test ( getRepo ( url ) ?. path ! ) ;
271
+ export const isPRFiles = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + \/ f i l e s / . test ( getRepo ( url ) ?. path ! ) || isPRCommit ( url ) ;
275
272
addTests ( 'isPRFiles' , [
273
+ 'isPRCommit' , // File contents but lacks "Viewed" checkbox, has commit information
276
274
'https://github.com/sindresorhus/refined-github/pull/148/files' ,
275
+ 'https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f' , // This means "every commit until e1aba6f"
276
+ 'https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f' , // This means specifically "Between commit A and B"
277
277
] ) ;
278
278
279
279
export const isQuickPR = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isCompare ( url ) && / [ ? & ] q u i c k _ p u l l = 1 ( & | $ ) / . test ( url . search ) ;
0 commit comments