Skip to content

Commit 9cde8e2

Browse files
committed
Add regex examples
1 parent b842fc0 commit 9cde8e2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/content/github/common/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// Note that we're guaranteed to be on a github page due to manifest.json,
22
// so these checks don't need to include that.
3+
4+
// This one matches PR files pages. Something like:
5+
// /codecov/gazebo/pull/2435/files
36
const prUrlRegex = /\/[^\/]+\/[^\/]+\/pull\/\d+\/files.*/
7+
8+
// And this one matches file view pages - which look like:
9+
// /codecov/gazebo/blob/main/src/App.jsx
410
const fileUrlRegex = /\/[^\/]+\/[^\/]+\/blob\/[^\/]+\/.*/
511

612
export function isFileUrl(url: string): boolean {

0 commit comments

Comments
 (0)