Skip to content

Commit 08c4459

Browse files
authored
Remove isSingleTag from isReleasesOrTags (#179)
1 parent 806243e commit 08c4459

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,16 @@ addTests('isTags', [
301301
'https://github.com/sindresorhus/refined-github/tags?after=21.8.1',
302302
]);
303303

304-
export const isSingleTag = (url: URL | HTMLAnchorElement | Location = location): boolean => /^(releases\/tag)/.test(getRepo(url)?.path!);
305-
addTests('isSingleTag', [
306-
'https://github.com/sindresorhus/refined-github/releases/tag/v1.0.0-beta.4',
307-
'https://github.com/sindresorhus/refined-github/releases/tag/0.2.1',
304+
export const isSingleReleaseOrTag = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path!.startsWith('releases/tag'));
305+
addTests('isSingleReleaseOrTag', [
306+
'https://github.com/refined-github/refined-github/releases/tag/1.20.1', // Tag
307+
'https://github.com/refined-github/refined-github/releases/tag/23.7.25', // Release
308308
]);
309309

310-
export const isReleasesOrTags = (url: URL | HTMLAnchorElement | Location = location): boolean => isReleases(url) || isTags(url) || isSingleTag(url);
310+
export const isReleasesOrTags = (url: URL | HTMLAnchorElement | Location = location): boolean => isReleases(url) || isTags(url);
311311
addTests('isReleasesOrTags', [
312312
'isReleases',
313313
'isTags',
314-
'isSingleTag',
315314
]);
316315

317316
export const isDeletingFile = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('delete'));

0 commit comments

Comments
 (0)