@@ -253,14 +253,31 @@ export const isOpenPR = (): boolean => exists('#partial-discussion-header [title
253
253
export const isMergedPR = ( ) : boolean => exists ( '#partial-discussion-header [title="Status: Merged"]' ) ;
254
254
export const isClosedPR = ( ) : boolean => exists ( '#partial-discussion-header [title="Status: Closed"], #partial-discussion-header [title="Status: Merged"]' ) ;
255
255
256
- export const isReleasesOrTags = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ t a g s $ | ^ r e l e a s e s ( $ | \/ t a g ) / . test ( getRepo ( url ) ?. path ! ) ;
257
- collect . set ( 'isReleasesOrTags ' , [
256
+ export const isReleases = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'releases' ;
257
+ collect . set ( 'isReleases ' , [
258
258
'https://github.com/sindresorhus/refined-github/releases' ,
259
+ 'https://github.com/sindresorhus/refined-github/releases?page=2' ,
260
+ ] ) ;
261
+
262
+ export const isTags = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'tags' ;
263
+ collect . set ( 'isTags' , [
259
264
'https://github.com/sindresorhus/refined-github/tags' ,
265
+ 'https://github.com/sindresorhus/refined-github/tags?after=21.8.1' ,
266
+ ] ) ;
267
+
268
+ export const isSingleTag = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ ( r e l e a s e s \/ t a g ) / . test ( getRepo ( url ) ?. path ! ) ;
269
+ collect . set ( 'isSingleTag' , [
260
270
'https://github.com/sindresorhus/refined-github/releases/tag/v1.0.0-beta.4' ,
261
271
'https://github.com/sindresorhus/refined-github/releases/tag/0.2.1' ,
262
272
] ) ;
263
273
274
+ export const isReleasesOrTags = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isReleases ( url ) || isTags ( url ) || isSingleTag ( url ) ;
275
+ collect . set ( 'isReleasesOrTags' , [
276
+ ...collect . get ( 'isReleases' ) as string [ ] ,
277
+ ...collect . get ( 'isTags' ) as string [ ] ,
278
+ ...collect . get ( 'isSingleTag' ) as string [ ] ,
279
+ ] ) ;
280
+
264
281
export const isDeletingFile = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => Boolean ( getRepo ( url ) ?. path . startsWith ( 'delete' ) ) ;
265
282
collect . set ( 'isDeletingFile' , [
266
283
'https://github.com/sindresorhus/refined-github/delete/master/readme.md' ,
@@ -540,12 +557,6 @@ collect.set('isUserProfileFollowingTab', [
540
557
'https://github.com/sindresorhus?tab=following' ,
541
558
] ) ;
542
559
543
- export const isSingleTag = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ ( r e l e a s e s \/ t a g ) / . test ( getRepo ( url ) ?. path ! ) ;
544
- collect . set ( 'isSingleTag' , [
545
- 'https://github.com/sindresorhus/refined-github/releases/tag/v1.0.0-beta.4' ,
546
- 'https://github.com/sindresorhus/refined-github/releases/tag/0.2.1' ,
547
- ] ) ;
548
-
549
560
collect . set ( 'hasComments' , combinedTestOnly ) ;
550
561
export const hasComments = ( url : URL | HTMLAnchorElement | Location = location ) : boolean =>
551
562
isPR ( url )
0 commit comments