Skip to content

Commit 84af41b

Browse files
authored
Meta, updates, lint (#2899)
1 parent 012c139 commit 84af41b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const _isCompare = [
5656
'https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1'
5757
];
5858

59-
export const isDashboard = (): boolean => !isGist() && /^$|^(orgs[/][^/]+[/])?dashboard([/]|$)/.test(getCleanPathname());
59+
export const isDashboard = (): boolean => !isGist() && /^$|^(orgs\/[^/]+\/)?dashboard(\/|$)/.test(getCleanPathname());
6060
export const _isDashboard = [
6161
'https://github.com/',
6262
'https://github.com',
@@ -136,7 +136,7 @@ export const _isNewRelease = [
136136
'https://github.com/sindresorhus/refined-github/releases/new'
137137
];
138138

139-
export const isNotifications = (): boolean => /^([^/]+[/][^/]+\/)?notifications/.test(getCleanPathname());
139+
export const isNotifications = (): boolean => /^((?:[^/]+\/){2})?notifications/.test(getCleanPathname());
140140
export const _isNotifications = [
141141
'https://github.com/notifications',
142142
'https://github.com/notifications/participating',
@@ -194,7 +194,7 @@ export const _isPRList = [
194194
'https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed'
195195
];
196196

197-
export const isPRCommit = (): boolean => /^pull\/\d+\/commits\/[0-9a-f]{5,40}/.test(getRepoPath()!);
197+
export const isPRCommit = (): boolean => /^pull\/\d+\/commits\/[\da-f]{5,40}/.test(getRepoPath()!);
198198
export const _isPRCommit = [
199199
'https://github.com/sindresorhus/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85',
200200
'https://github.com/sindresorhus/refined-github/pull/148/commits/00196'
@@ -293,7 +293,7 @@ export const _isRepoIssueList = [
293293
'https://github.com/sindresorhus/refined-github/issues?q=is%3Aclosed+sort%3Aupdated-desc'
294294
];
295295

296-
export const isRepoRoot = (): boolean => /^(tree[/][^/]+)?$/.test(getRepoPath()!);
296+
export const isRepoRoot = (): boolean => /^(tree\/[^/]+)?$/.test(getRepoPath()!);
297297
export const _isRepoRoot = [
298298
// Some tests are here only as "gotchas" for other tests that may misidentify their pages
299299
'https://github.com/sindresorhus/edit',
@@ -333,7 +333,7 @@ export const _isRepoTree = [
333333
export const isRepoWithAccess = (): boolean => isRepo() && select.exists('.reponav-item[href$="/settings"]');
334334
export const _isRepoWithAccess = domBased;
335335

336-
export const isSingleCommit = (): boolean => /^commit\/[0-9a-f]{5,40}/.test(getRepoPath()!);
336+
export const isSingleCommit = (): boolean => /^commit\/[\da-f]{5,40}/.test(getRepoPath()!);
337337
export const _isSingleCommit = [
338338
'https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f',
339339
'https://github.com/sindresorhus/refined-github/commit/5b614'
@@ -351,7 +351,7 @@ export const _isFileFinder = [
351351
'https://github.com/sindresorhus/refined-github/find/master'
352352
];
353353

354-
export const isSingleGist = (): boolean => isGist() && /^\/(gist\/)?[^/]+\/[0-9a-f]{32}$/.test(location.pathname);
354+
export const isSingleGist = (): boolean => isGist() && /^\/(gist\/)?[^/]+\/[\da-f]{32}$/.test(location.pathname);
355355
export const _isSingleGist = [
356356
'https://gist.github.com/sindresorhus/0ea3c2845718a0a0f0beb579ff14f064'
357357
];

0 commit comments

Comments
 (0)