Skip to content

Commit

Permalink
Remove isSingleTag from isReleasesOrTags (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jul 31, 2023
1 parent 806243e commit 08c4459
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,16 @@ addTests('isTags', [
'https://github.com/sindresorhus/refined-github/tags?after=21.8.1',
]);

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

export const isReleasesOrTags = (url: URL | HTMLAnchorElement | Location = location): boolean => isReleases(url) || isTags(url) || isSingleTag(url);
export const isReleasesOrTags = (url: URL | HTMLAnchorElement | Location = location): boolean => isReleases(url) || isTags(url);
addTests('isReleasesOrTags', [
'isReleases',
'isTags',
'isSingleTag',
]);

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

0 comments on commit 08c4459

Please sign in to comment.