Skip to content

Commit aef4af0

Browse files
authored
Add isProfileRepoList (#170)
1 parent 4f25492 commit aef4af0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/setup-node@v3
2424
with:
2525
node-version: 18
26-
registry-url: 'https://registry.npmjs.org'
26+
registry-url: https://registry.npmjs.org
2727
- run: npm ci || npm install
2828
- uses: fregante/setup-git-user@v2
2929
- name: Create version

index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,16 @@ addTests('isUserProfileFollowingTab', [
629629
'https://github.com/sindresorhus?tab=following',
630630
]);
631631

632+
export const isProfileRepoList = (url: URL | HTMLAnchorElement | Location = location): boolean =>
633+
isUserProfileRepoTab(url) || getOrg(url)?.path === 'repositories';
634+
addTests('isProfileRepoList', [
635+
'https://github.com/fregante?tab=repositories',
636+
'https://github.com/fregante?tab=repositories&type=source',
637+
'https://github.com/fregante?tab=repositories&q=&type=source&language=css&sort=',
638+
'https://github.com/orgs/refined-github/repositories',
639+
'https://github.com/orgs/refined-github/repositories?q=&type=private&language=&sort=',
640+
]);
641+
632642
addTests('hasComments', combinedTestOnly);
633643
export const hasComments = (url: URL | HTMLAnchorElement | Location = location): boolean =>
634644
isPR(url)

test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ for (const [detectName, detect] of Object.entries(pageDetect)) {
3838
Is this URL \`${detectName}\`?
3939
${url.replace('https://github.com', '')}
4040
41-
• Yes? The \`${detectName}\` test is wrong and should be fixed.
41+
• Yes? The \`${detectName}\` detection is wrong and should be fixed.
4242
• No? Remove it from its \`collect.set()\` array.
4343
`),
4444
);
@@ -60,7 +60,7 @@ for (const [detectName, detect] of Object.entries(pageDetect)) {
6060
${url.replace('https://github.com', '')}
6161
6262
• Yes? Add it to the \`collect.set()\` array.
63-
• No? The \`${detectName}\` test is wrong and should be fixed.
63+
• No? The \`${detectName}\` detection is wrong and should be fixed.
6464
`),
6565
);
6666
});

0 commit comments

Comments
 (0)