github-url-detection 11.0.0 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,7 @@ export declare const is404: () => boolean;
3
3
  export declare const is500: () => boolean;
4
4
  export declare const isPasswordConfirmation: () => boolean;
5
5
  export declare const isLoggedIn: () => boolean;
6
- /**
7
- * @example https://github.com/sindresorhus/refined-github/blame/master/package.json
8
- */
6
+ /** @example https://github.com/sindresorhus/refined-github/blame/master/package.json */
9
7
  export declare const isBlame: (url?: URL | HTMLAnchorElement | Location) => boolean;
10
8
  /**
11
9
  * @example https://github.com/sindresorhus/refined-github/commit/5b614b9035f2035b839f48b4db7bd5c3298d526f
@@ -100,13 +98,9 @@ export declare const isGist: (url?: URL | HTMLAnchorElement | Location) => boole
100
98
  * @example https://github.com/pulls/review-requested
101
99
  */
102
100
  export declare const isGlobalIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
103
- /**
104
- * @example https://github.com/search?q=refined-github&ref=opensearch
105
- */
101
+ /** @example https://github.com/search?q=refined-github&ref=opensearch */
106
102
  export declare const isGlobalSearchResults: (url?: URL | HTMLAnchorElement | Location) => boolean;
107
- /**
108
- * @example https://github.com/sindresorhus/refined-github/issues/146
109
- */
103
+ /** @example https://github.com/sindresorhus/refined-github/issues/146 */
110
104
  export declare const isIssue: (url?: URL | HTMLAnchorElement | Location) => boolean;
111
105
  export declare const isIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
112
106
  export declare const isConversation: (url?: URL | HTMLAnchorElement | Location) => boolean;
@@ -115,33 +109,19 @@ export declare const isConversation: (url?: URL | HTMLAnchorElement | Location)
115
109
  * @example https://github.com/sindresorhus/refined-github/labels/
116
110
  */
117
111
  export declare const isLabelList: (url?: URL | HTMLAnchorElement | Location) => boolean;
118
- /**
119
- * @example https://github.com/kubernetes/kubernetes/milestone/56
120
- */
112
+ /** @example https://github.com/kubernetes/kubernetes/milestone/56 */
121
113
  export declare const isMilestone: (url?: URL | HTMLAnchorElement | Location) => boolean;
122
- /**
123
- * @example https://github.com/sindresorhus/refined-github/milestones
124
- */
114
+ /** @example https://github.com/sindresorhus/refined-github/milestones */
125
115
  export declare const isMilestoneList: (url?: URL | HTMLAnchorElement | Location) => boolean;
126
- /**
127
- * @example https://github.com/sindresorhus/refined-github/new/main
128
- */
116
+ /** @example https://github.com/sindresorhus/refined-github/new/main */
129
117
  export declare const isNewFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
130
- /**
131
- * @example https://github.com/sindresorhus/refined-github/issues/new
132
- */
118
+ /** @example https://github.com/sindresorhus/refined-github/issues/new */
133
119
  export declare const isNewIssue: (url?: URL | HTMLAnchorElement | Location) => boolean;
134
- /**
135
- * @example https://github.com/sindresorhus/refined-github/releases/new
136
- */
120
+ /** @example https://github.com/sindresorhus/refined-github/releases/new */
137
121
  export declare const isNewRelease: (url?: URL | HTMLAnchorElement | Location) => boolean;
138
- /**
139
- * @example https://github.com/tooomm/wikitest/wiki/_new
140
- */
122
+ /** @example https://github.com/tooomm/wikitest/wiki/_new */
141
123
  export declare const isNewWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
142
- /**
143
- * @example https://github.com/notifications
144
- */
124
+ /** @example https://github.com/notifications */
145
125
  export declare const isNotifications: (url?: URL | HTMLAnchorElement | Location) => boolean;
146
126
  export declare const isOrganizationProfile: () => boolean;
147
127
  export declare const isOrganizationRepo: () => boolean;
@@ -158,9 +138,7 @@ export declare const isOwnOrganizationProfile: () => boolean;
158
138
  * @example https://github.com/orgs/RSSNext/projects/3
159
139
  */
160
140
  export declare const isProject: (url?: URL | HTMLAnchorElement | Location) => boolean;
161
- /**
162
- * @example https://github.com/sindresorhus/refined-github/projects
163
- */
141
+ /** @example https://github.com/sindresorhus/refined-github/projects */
164
142
  export declare const isProjects: (url?: URL | HTMLAnchorElement | Location) => boolean;
165
143
  /**
166
144
  * @example https://github.com/tophf/mpiv/discussions/50
@@ -192,9 +170,7 @@ export declare const isDiscussionList: (url?: URL | HTMLAnchorElement | Location
192
170
  * @example https://github.com/sindresorhus/refined-github/pull/148
193
171
  */
194
172
  export declare const isPR: (url?: URL | HTMLAnchorElement | Location) => boolean;
195
- /**
196
- * @example https://github.com/sindresorhus/refined-github/pull/148/conflicts
197
- */
173
+ /** @example https://github.com/sindresorhus/refined-github/pull/148/conflicts */
198
174
  export declare const isPRConflicts: (url?: URL | HTMLAnchorElement | Location) => boolean;
199
175
  /**
200
176
  * Any `isIssueOrPRList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown
@@ -215,13 +191,9 @@ export declare const isPRList: (url?: URL | HTMLAnchorElement | Location) => boo
215
191
  export declare const isPRCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
216
192
  export declare const isPRCommit404: () => boolean;
217
193
  export declare const isPRFile404: () => boolean;
218
- /**
219
- * @example https://github.com/sindresorhus/refined-github/pull/148
220
- */
194
+ /** @example https://github.com/sindresorhus/refined-github/pull/148 */
221
195
  export declare const isPRConversation: (url?: URL | HTMLAnchorElement | Location) => boolean;
222
- /**
223
- * @example https://github.com/sindresorhus/refined-github/pull/148/commits
224
- */
196
+ /** @example https://github.com/sindresorhus/refined-github/pull/148/commits */
225
197
  export declare const isPRCommitList: (url?: URL | HTMLAnchorElement | Location) => boolean;
226
198
  /**
227
199
  * @example https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d7998afdd3608d9fc3bf95ccf27fa5010641
@@ -279,14 +251,10 @@ export declare const isDeletingFile: (url?: URL | HTMLAnchorElement | Location)
279
251
  */
280
252
  export declare const isEditingFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
281
253
  export declare const hasFileEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
282
- /**
283
- * @example https://github.com/sindresorhus/refined-github/releases/edit/v1.2.3
284
- */
254
+ /** @example https://github.com/sindresorhus/refined-github/releases/edit/v1.2.3 */
285
255
  export declare const isEditingRelease: (url?: URL | HTMLAnchorElement | Location) => boolean;
286
256
  export declare const hasReleaseEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
287
- /**
288
- * @example https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit
289
- */
257
+ /** @example https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit */
290
258
  export declare const isEditingWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
291
259
  export declare const hasWikiPageEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
292
260
  /**
@@ -377,9 +345,7 @@ export declare const isRepoSearch: (url?: URL | HTMLAnchorElement | Location) =>
377
345
  * @example https://github.com/sindresorhus/refined-github/settings/branches
378
346
  */
379
347
  export declare const isRepoSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
380
- /**
381
- * @example https://github.com/sindresorhus/refined-github/settings
382
- */
348
+ /** @example https://github.com/sindresorhus/refined-github/settings */
383
349
  export declare const isRepoMainSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
384
350
  /**
385
351
  * @example https://github.com/settings/replies
@@ -432,27 +398,19 @@ export declare const isSingleCommit: (url?: URL | HTMLAnchorElement | Location)
432
398
  * @example https://github.com/sindresorhus/refined-github/blob/master/edit.txt
433
399
  */
434
400
  export declare const isSingleFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
435
- /**
436
- * @example https://github.com/sindresorhus/refined-github/find/master
437
- */
401
+ /** @example https://github.com/sindresorhus/refined-github/find/master */
438
402
  export declare const isFileFinder: (url?: URL | HTMLAnchorElement | Location) => boolean;
439
403
  /**
440
404
  * @example https://github.com/fregante/GhostText/tree/3cacd7df71b097dc525d99c7aa2f54d31b02fcc8/chrome/scripts/InputArea
441
405
  * @example https://github.com/refined-github/refined-github/blob/some-non-existent-ref/source/features/bugs-tab.tsx
442
406
  */
443
407
  export declare const isRepoFile404: (url?: URL | HTMLAnchorElement | Location) => boolean;
444
- /**
445
- * @example https://github.com/sindresorhus/refined-github/network/members
446
- */
408
+ /** @example https://github.com/sindresorhus/refined-github/network/members */
447
409
  export declare const isRepoForksList: (url?: URL | HTMLAnchorElement | Location) => boolean;
448
- /**
449
- * @example https://github.com/sindresorhus/refined-github/network
450
- */
410
+ /** @example https://github.com/sindresorhus/refined-github/network */
451
411
  export declare const isRepoNetworkGraph: (url?: URL | HTMLAnchorElement | Location) => boolean;
452
412
  export declare const isForkedRepo: () => boolean;
453
- /**
454
- * @example https://github.com/refined-github/refined-github/fork
455
- */
413
+ /** @example https://github.com/refined-github/refined-github/fork */
456
414
  export declare const isForkingRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
457
415
  /**
458
416
  * @example https://gist.github.com/fregante/2205329b71218fa2c1d3
@@ -460,9 +418,7 @@ export declare const isForkingRepo: (url?: URL | HTMLAnchorElement | Location) =
460
418
  * @example https://gist.github.com/sindresorhus/0ea3c2845718a0a0f0beb579ff14f064
461
419
  */
462
420
  export declare const isSingleGist: (url?: URL | HTMLAnchorElement | Location) => boolean;
463
- /**
464
- * @example https://gist.github.com/kidonng/0d16c7f17045f486751fad1b602204a0/revisions
465
- */
421
+ /** @example https://gist.github.com/kidonng/0d16c7f17045f486751fad1b602204a0/revisions */
466
422
  export declare const isGistRevision: (url?: URL | HTMLAnchorElement | Location) => boolean;
467
423
  /**
468
424
  * @example https://github.com/trending
@@ -470,9 +426,7 @@ export declare const isGistRevision: (url?: URL | HTMLAnchorElement | Location)
470
426
  * @example https://github.com/trending/unknown
471
427
  */
472
428
  export declare const isTrending: (url?: URL | HTMLAnchorElement | Location) => boolean;
473
- /**
474
- * @example https://github.com/sindresorhus/refined-github/branches
475
- */
429
+ /** @example https://github.com/sindresorhus/refined-github/branches */
476
430
  export declare const isBranches: (url?: URL | HTMLAnchorElement | Location) => boolean;
477
431
  /**
478
432
  * @example https://github.com/fregante
@@ -578,9 +532,7 @@ export declare const isActionJobRun: (url?: URL | HTMLAnchorElement | Location)
578
532
  * @example https://github.com/refined-github/github-url-detection/actions/runs/294962314
579
533
  */
580
534
  export declare const isActionRun: (url?: URL | HTMLAnchorElement | Location) => boolean;
581
- /**
582
- * @example https://github.com/sindresorhus/refined-github/actions/new
583
- */
535
+ /** @example https://github.com/sindresorhus/refined-github/actions/new */
584
536
  export declare const isNewAction: (url?: URL | HTMLAnchorElement | Location) => boolean;
585
537
  /**
586
538
  * @example https://github.com/refined-github/github-url-detection/actions
@@ -595,9 +547,7 @@ export declare const canUserAdminRepo: () => boolean;
595
547
  * @example https://github.com/organizations/npmhub/repositories/new
596
548
  */
597
549
  export declare const isNewRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
598
- /**
599
- * @example https://github.com/fregante/browser-extension-template/generate
600
- */
550
+ /** @example https://github.com/fregante/browser-extension-template/generate */
601
551
  export declare const isNewRepoTemplate: (url?: URL | HTMLAnchorElement | Location) => boolean;
602
552
  export type NameWithOwner = `${string}/${string}`;
603
553
  export type RepositoryInfo = {
@@ -51,8 +51,9 @@ var isQuickPR = (url = location) => isCompare(url) && /[?&]quick_pull=1(&|$)/.te
51
51
  var getStateLabel = () => $([
52
52
  ".State",
53
53
  // Old view
54
- '[class^="StateLabel"]'
55
- // React version
54
+ // React versions
55
+ '[class^="StateLabel"]',
56
+ '[data-testid="header-state"]'
56
57
  ].join(","))?.textContent?.trim();
57
58
  var isMergedPR = () => getStateLabel() === "Merged";
58
59
  var isDraftPR = () => getStateLabel() === "Draft";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-url-detection",
3
- "version": "11.0.0",
3
+ "version": "11.0.1",
4
4
  "description": "Which GitHub page are you on? Is it an issue? Is it a list? Perfect for your WebExtension or userscript.",
5
5
  "keywords": [
6
6
  "github",
@@ -27,7 +27,7 @@
27
27
  "build": "run-p build:*",
28
28
  "build:esbuild": "esbuild index.ts --bundle --external:github-reserved-names --outdir=distribution --format=esm --drop-labels=TEST",
29
29
  "build:typescript": "tsc",
30
- "postbuild:typescript": "node add-examples-to-dts.ts",
30
+ "postbuild:typescript": "tsx add-examples-to-dts.ts",
31
31
  "build:demo": "vite build demo",
32
32
  "try": "esbuild index.ts --bundle --global-name=x --format=iife | pbcopy && echo 'Copied to clipboard'",
33
33
  "fix": "xo --fix",
@@ -54,6 +54,8 @@
54
54
  "strip-indent": "^4.1.1",
55
55
  "svelte": "^5.46.1",
56
56
  "svelte-check": "^4.3.5",
57
+ "ts-morph": "^27.0.2",
58
+ "tsx": "^4.21.0",
57
59
  "typescript": "5.9.3",
58
60
  "vite": "^7.3.1",
59
61
  "vitest": "^4.0.17",