Skip to content

Commit 38a2573

Browse files
authored
Rename discussionconversation (#17)
1 parent 0c856d2 commit 38a2573

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ collect.set('isGist', [
7979
'https://my-little-hub.com/gist',
8080
]);
8181

82-
export const isGlobalDiscussionList = (url: URL | Location = location): boolean => ['issues', 'pulls'].includes(url.pathname.split('/', 2)[1]);
83-
collect.set('isGlobalDiscussionList', [
82+
export const isGlobalConversationList = (url: URL | Location = location): boolean => ['issues', 'pulls'].includes(url.pathname.split('/', 2)[1]);
83+
collect.set('isGlobalConversationList', [
8484
'https://github.com/issues',
8585
'https://github.com/issues?q=is%3Apr+is%3Aopen',
8686
'https://github.com/issues/assigned',
@@ -102,8 +102,8 @@ collect.set('isIssue', [
102102
'https://github.com/sindresorhus/refined-github/issues/146',
103103
]);
104104

105-
export const isDiscussionList = (url: URL | Location = location): boolean => isGlobalDiscussionList(url) || isRepoDiscussionList(url);
106-
collect.set('isDiscussionList', combinedTestOnly);
105+
export const isConversationList = (url: URL | Location = location): boolean => isGlobalConversationList(url) || isRepoConversationList(url);
106+
collect.set('isConversationList', combinedTestOnly);
107107

108108
export const isLabelList = (url: URL | Location = location): boolean => getRepoPath(url) === 'labels';
109109
collect.set('isLabelList', [
@@ -172,7 +172,7 @@ collect.set('isPRConflicts', [
172172
export const isConflict = isPRConflicts;
173173
collect.set('isConflict', combinedTestOnly);
174174

175-
/** Any `isDiscussionList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown */
175+
/** Any `isConversationList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown */
176176
export const isPRList = (url: URL | Location = location): boolean => url.pathname === '/pulls' || getRepoPath(url) === 'pulls';
177177
collect.set('isPRList', [
178178
'https://github.com/pulls',
@@ -243,8 +243,8 @@ collect.set('isRepo', [
243243
'https://github.com/sindresorhus/refined-github/issues/146',
244244
'https://github.com/sindresorhus/notifications/',
245245
'https://github.com/sindresorhus/refined-github/pull/148',
246-
'https://github.com/sindresorhus/refined-github/milestones/new', // Gotcha for isRepoTaxonomyDiscussionList
247-
'https://github.com/sindresorhus/refined-github/milestones/1/edit', // Gotcha for isRepoTaxonomyDiscussionList
246+
'https://github.com/sindresorhus/refined-github/milestones/new', // Gotcha for isRepoTaxonomyConversationList
247+
'https://github.com/sindresorhus/refined-github/milestones/1/edit', // Gotcha for isRepoTaxonomyConversationList
248248
'https://github.com/sindresorhus/refined-github/issues/new/choose', // Gotcha for isRepoIssueList
249249
'https://github.com/sindresorhus/refined-github/issues/templates/edit', // Gotcha for isRepoIssueList
250250
]);
@@ -254,17 +254,17 @@ export const isEmptyRepo = (): boolean => isRepo() && exists('.blankslate');
254254

255255
export const isEmptyRepoRoot = (): boolean => isRepoRoot() && exists('.blankslate');
256256

257-
export const isRepoTaxonomyDiscussionList = (url: URL | Location = location): boolean => /^labels\/.+|^milestones\/\d+(?!\/edit)/.test(getRepoPath(url)!);
258-
collect.set('isRepoTaxonomyDiscussionList', [
257+
export const isRepoTaxonomyConversationList = (url: URL | Location = location): boolean => /^labels\/.+|^milestones\/\d+(?!\/edit)/.test(getRepoPath(url)!);
258+
collect.set('isRepoTaxonomyConversationList', [
259259
'https://github.com/sindresorhus/refined-github/labels/Priority%3A%20critical',
260260
'https://github.com/sindresorhus/refined-github/milestones/1',
261261
]);
262262

263-
export const isRepoDiscussionList = (url: URL | Location = location): boolean =>
263+
export const isRepoConversationList = (url: URL | Location = location): boolean =>
264264
isRepoPRList(url) ||
265265
isRepoIssueList(url) ||
266-
isRepoTaxonomyDiscussionList(url);
267-
collect.set('isRepoDiscussionList', combinedTestOnly);
266+
isRepoTaxonomyConversationList(url);
267+
collect.set('isRepoConversationList', combinedTestOnly);
268268

269269
export const isRepoPRList = (url: URL | Location = location): boolean => String(getRepoPath(url)).startsWith('pulls');
270270
collect.set('isRepoPRList', [

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (pageDetect.isRepo()) { // Uses `window.location.href` by default
3333
alert('You’re looking at a repo!')
3434
}
3535

36-
if (pageDetect.isDiscussionList()) {
36+
if (pageDetect.isConversationList()) {
3737
alert('You’re looking at a issues and PRs list!')
3838
}
3939
```
@@ -49,13 +49,13 @@ Most detections are URL-based while others need access to the current `document`
4949
By default, URL-based detections use the `location` global if you don't pass a `url` argument.
5050

5151
```js
52-
if (pageDetect.isDiscussionList()) {
52+
if (pageDetect.isConversationList()) {
5353
alert('You’re looking at a issues or PRs list!')
5454
}
5555
```
5656

5757
```js
58-
if (pageDetect.isDiscussionList(new URL('https://github.com/fregante/github-url-detection/pulls'))) {
58+
if (pageDetect.isConversationList(new URL('https://github.com/fregante/github-url-detection/pulls'))) {
5959
alert('You’re looking at a issues or PRs list!')
6060
}
6161
```

0 commit comments

Comments
 (0)