Skip to content

Commit 91f1e93

Browse files
authored
Tighten isCommit and isPRCommit pattern (#110)
1 parent bbaf41c commit 91f1e93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ collect.set('isPRList', [
225225
'https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed',
226226
]);
227227

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

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

0 commit comments

Comments
 (0)