Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,16 @@ TEST: addTests('isPRCommitList', [
'https://github.com/sindresorhus/refined-github/pull/148/commits',
]);

export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/files/.test(getRepo(url)?.path) || isPRCommit(url);
export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(files|(changes(\/[\da-f]{7,40}..[\da-f]{7,40})?$))/.test(getRepo(url)?.path) || isPRCommit(url);
TEST: addTests('isPRFiles', [
'isPRCommit', // File contents but lacks "Viewed" checkbox, has commit information
'https://github.com/sindresorhus/refined-github/pull/148/files',
'https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f', // This means "every commit until e1aba6f"
'https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f', // This means specifically "Between commit A and B"
// Since December 2025
'https://github.com/refined-github/refined-github/pull/148/changes',
'https://github.com/refined-github/refined-github/pull/148/changes/1e27d799..e1aba6f', // This means specifically "Between commit A and B"
'https://github.com/refined-github/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641..e1aba6febb3fe38aafd1137cff28b536eeeabe7e',
]);

export const isQuickPR = (url: URL | HTMLAnchorElement | Location = location): boolean => isCompare(url) && /[?&]quick_pull=1(&|$)/.test(url.search);
Expand Down