github-url-detection 10.0.2 → 10.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.
@@ -114,6 +114,8 @@ export declare const hasComments: (url?: URL | HTMLAnchorElement | Location) =>
114
114
  export declare const hasRichTextEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
115
115
  /** Static code, not the code editor */
116
116
  export declare const hasCode: (url?: URL | HTMLAnchorElement | Location) => boolean;
117
+ /** Covers blob, trees and blame pages */
118
+ export declare const isRepoGitObject: (url?: URL | HTMLAnchorElement | Location) => boolean;
117
119
  /** Has a list of files */
118
120
  export declare const hasFiles: (url?: URL | HTMLAnchorElement | Location) => boolean;
119
121
  export declare const isMarketplaceAction: (url?: URL | HTMLAnchorElement | Location) => boolean;
@@ -167,6 +167,7 @@ var isProfileRepoList = (url = location) => isUserProfileRepoTab(url) || getOrg(
167
167
  var hasComments = (url = location) => isPR(url) || isIssue(url) || isCommit(url) || isTeamDiscussion(url) || isSingleGist(url);
168
168
  var hasRichTextEditor = (url = location) => hasComments(url) || isNewIssue(url) || isCompare(url) || isRepliesSettings(url) || hasReleaseEditor(url) || isDiscussion(url) || isNewDiscussion(url);
169
169
  var hasCode = (url = location) => hasComments(url) || isRepoTree(url) || isRepoSearch(url) || isGlobalSearchResults(url) || isSingleFile(url) || isGist(url) || isCompare(url) || isCompareWikiPage(url) || isBlame(url);
170
+ var isRepoGitObject = (url = location) => isRepo(url) && [void 0, "blob", "tree", "blame"].includes(getCleanPathname(url).split("/")[2]);
170
171
  var hasFiles = (url = location) => isCommit(url) || isCompare(url) || isPRFiles(url);
171
172
  var isMarketplaceAction = (url = location) => url.pathname.startsWith("/marketplace/actions/");
172
173
  var isActionJobRun = (url = location) => Boolean(getRepo(url)?.path.startsWith("runs/"));
@@ -318,6 +319,7 @@ export {
318
319
  isRepoCommitList,
319
320
  isRepoFile404,
320
321
  isRepoForksList,
322
+ isRepoGitObject,
321
323
  isRepoHome,
322
324
  isRepoIssueList,
323
325
  isRepoIssueOrPRList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-url-detection",
3
- "version": "10.0.2",
3
+ "version": "10.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",