Skip to content

Commit

Permalink
Tighten isCommit and isPRCommit pattern (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
kidonng committed Jan 14, 2022
1 parent bbaf41c commit 91f1e93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ collect.set('isPRList', [
'https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed',
]);

export const isPRCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/commits\/[\da-f]{5,40}/.test(getRepo(url)?.path!);
export const isPRCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/commits\/[\da-f]{5,40}$/.test(getRepo(url)?.path!);
collect.set('isPRCommit', [
'https://github.com/sindresorhus/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85',
'https://github.com/sindresorhus/refined-github/pull/148/commits/00196',
Expand Down Expand Up @@ -468,7 +468,7 @@ collect.set('isRepoWiki', [
'https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit',
]);

export const isSingleCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^commit\/[\da-f]{5,40}/.test(getRepo(url)?.path!);
export const isSingleCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^commit\/[\da-f]{5,40}$/.test(getRepo(url)?.path!);
collect.set('isSingleCommit', [
'https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f',
'https://github.com/sindresorhus/refined-github/commit/5b614',
Expand Down

0 comments on commit 91f1e93

Please sign in to comment.