github-url-detection 8.0.0 → 8.1.0

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.
@@ -83,6 +83,11 @@ export declare const isRepoWiki: (url?: URL | HTMLAnchorElement | Location) => b
83
83
  export declare const isSingleCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
84
84
  export declare const isSingleFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
85
85
  export declare const isFileFinder: (url?: URL | HTMLAnchorElement | Location) => boolean;
86
+ /**
87
+ * @example https://github.com/fregante/GhostText/tree/3cacd7df71b097dc525d99c7aa2f54d31b02fcc8/chrome/scripts/InputArea
88
+ * @example https://github.com/refined-github/refined-github/blob/some-non-existent-ref/source/features/bugs-tab.tsx
89
+ */
90
+ export declare const isRepoFile404: (url?: URL | HTMLAnchorElement | Location) => boolean;
86
91
  export declare const isRepoForksList: (url?: URL | HTMLAnchorElement | Location) => boolean;
87
92
  export declare const isRepoNetworkGraph: (url?: URL | HTMLAnchorElement | Location) => boolean;
88
93
  export declare const isForkedRepo: () => boolean;
@@ -379,6 +379,7 @@ const isRepoWiki = (url = location) => Boolean(getRepo(url)?.path.startsWith("wi
379
379
  const isSingleCommit = (url = location) => /^commit\/[\da-f]{5,40}$/.test(getRepo(url)?.path);
380
380
  const isSingleFile = (url = location) => Boolean(getRepo(url)?.path.startsWith("blob/"));
381
381
  const isFileFinder = (url = location) => Boolean(getRepo(url)?.path.startsWith("find/"));
382
+ const isRepoFile404 = (url = location) => (isSingleFile(url) || isRepoTree(url)) && document.title.startsWith("File not found");
382
383
  const isRepoForksList = (url = location) => getRepo(url)?.path === "network/members";
383
384
  const isRepoNetworkGraph = (url = location) => getRepo(url)?.path === "network";
384
385
  const isForkedRepo = () => exists('meta[name="octolytics-dimension-repository_is_fork"][content="true"]');
@@ -544,6 +545,7 @@ export {
544
545
  isRepliesSettings,
545
546
  isRepo,
546
547
  isRepoCommitList,
548
+ isRepoFile404,
547
549
  isRepoForksList,
548
550
  isRepoHome,
549
551
  isRepoIssueList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-url-detection",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
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",