Skip to content

Commit 23a3921

Browse files
authored
Fix isRepoRoot (#21)
1 parent 56a88f7 commit 23a3921

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ collect.set('isRepoHome', [
293293
]);
294294

295295
export const isRepoRoot = (url?: URL | Location): boolean =>
296-
/^(tree\/[^/]+)?$/.test(getRepoPath(url ?? location)!) ||
297-
(!url && document.title.startsWith(getRepoURL()) && !document.title.endsWith(getRepoURL())); // #15
296+
/^(tree\/[^/]+)?$/.test(getRepoPath(url ?? location)!) &&
297+
(url ? true : (document.title.startsWith(getRepoURL()) && !document.title.endsWith(getRepoURL()))); // #15
298298
collect.set('isRepoRoot', [
299299
...collect.get('isRepoHome') as string[],
300300
'https://github.com/sindresorhus/refined-github/tree/native-copy-buttons',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@rollup/plugin-typescript": "^4.1.2",
6868
"@sindresorhus/tsconfig": "^0.7.0",
6969
"@types/jsdom": "^16.2.3",
70-
"ava": "^3.8.2",
70+
"ava": "^3.10.0",
7171
"esm": "^3.2.25",
7272
"github-reserved-names": "^1.1.8",
7373
"jsdom": "^16.2.2",

0 commit comments

Comments
 (0)