github-url-detection 5.11.0 → 5.13.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.
- package/distribution/index.d.ts +4 -0
- package/distribution/index.js +11 -3
- package/package.json +1 -1
package/distribution/index.d.ts
CHANGED
|
@@ -46,6 +46,8 @@ export declare const isQuickPR: (url?: URL | HTMLAnchorElement | Location) => bo
|
|
|
46
46
|
export declare const isDraftPR: () => boolean;
|
|
47
47
|
export declare const isOpenPR: () => boolean;
|
|
48
48
|
export declare const isMergedPR: () => boolean;
|
|
49
|
+
export declare const isClosedConversation: () => boolean;
|
|
50
|
+
/** @deprecated Use isClosedConversation */
|
|
49
51
|
export declare const isClosedPR: () => boolean;
|
|
50
52
|
export declare const isReleases: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
51
53
|
export declare const isTags: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
@@ -61,6 +63,7 @@ export declare const hasWikiPageEditor: (url?: URL | HTMLAnchorElement | Locatio
|
|
|
61
63
|
export declare const isRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
62
64
|
export declare const isEmptyRepoRoot: () => boolean;
|
|
63
65
|
export declare const isEmptyRepo: () => boolean;
|
|
66
|
+
export declare const isArchivedRepo: () => boolean;
|
|
64
67
|
export declare const isBlank: () => boolean;
|
|
65
68
|
export declare const isRepoTaxonomyConversationList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
66
69
|
export declare const isRepoConversationList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
@@ -87,6 +90,7 @@ export declare const isTrending: (url?: URL | HTMLAnchorElement | Location) => b
|
|
|
87
90
|
export declare const isBranches: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
88
91
|
export declare const isProfile: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
89
92
|
export declare const isUserProfile: () => boolean;
|
|
93
|
+
export declare const isPrivateUserProfile: () => boolean;
|
|
90
94
|
export declare const isUserProfileMainTab: () => boolean;
|
|
91
95
|
export declare const isUserProfileRepoTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
92
96
|
export declare const isUserProfileStarsTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
package/distribution/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
var reservedNames = [ "400", "401", "402", "403", "404", "405", "406", "407", "408", "409", "410", "411", "412", "413", "414", "415", "416", "417", "418", "419", "420", "421", "422", "423", "424", "425", "426", "427", "428", "429", "430", "431", "500", "501", "502", "503", "504", "505", "506", "507", "508", "509", "510", "511", "about", "access", "account", "admin", "advisories", "anonymous", "any", "api", "apps", "attributes", "auth", "billing", "blob", "blog", "bounty", "branches", "business", "businesses", "c", "cache", "case-studies", "categories", "central", "certification", "changelog", "cla", "cloud", "codereview", "collection", "collections", "comments", "commit", "commits", "community", "companies", "compare", "contact", "contributing", "cookbook", "coupons", "customer-stories", "customer", "customers", "dashboard", "dashboards", "design", "develop", "developer", "diff", "discover", "discussions", "docs", "downloads", "downtime", "editor", "editors", "edu", "enterprise", "events", "explore", "featured", "features", "files", "fixtures", "forked", "garage", "ghost", "gist", "gists", "graphs", "guide", "guides", "help", "help-wanted", "home", "hooks", "hosting", "hovercards", "identity", "images", "inbox", "individual", "info", "integration", "interfaces", "introduction", "invalid-email-address", "investors", "issues", "jobs", "join", "journal", "journals", "lab", "labs", "languages", "launch", "layouts", "learn", "legal", "library", "linux", "listings", "lists", "login", "logos", "logout", "mac", "maintenance", "malware", "man", "marketplace", "mention", "mentioned", "mentioning", "mentions", "migrating", "milestones", "mine", "mirrors", "mobile", "navigation", "network", "new", "news", "none", "nonprofit", "nonprofits", "notices", "notifications", "oauth", "offer", "open-source", "organisations", "organizations", "orgs", "pages", "partners", "payments", "personal", "plans", "plugins", "popular", "popularity", "posts", "press", "pricing", "professional", "projects", "pulls", "raw", "readme", "recommendations", "redeem", "releases", "render", "reply", "repositories", "resources", "restore", "revert", "save-net-neutrality", "saved", "scraping", "search", "security", "services", "sessions", "settings", "shareholders", "shop", "showcases", "signin", "signup", "site", "spam", "sponsors", "ssh", "staff", "starred", "stars", "static", "status", "statuses", "storage", "store", "stories", "styleguide", "subscriptions", "suggest", "suggestion", "suggestions", "support", "suspended", "talks", "teach", "teacher", "teachers", "teaching", "team", "teams", "ten", "terms", "timeline", "topic", "topics", "tos", "tour", "train", "training", "translations", "tree", "trending", "updates", "username", "users", "visualization", "w", "watching", "wiki", "windows", "works-with", "www0", "www1", "www2", "www3", "www4", "www5", "www6", "www7", "www8", "www9" ];
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const $ = selector => document.querySelector(selector);
|
|
4
|
+
|
|
5
|
+
const exists = selector => Boolean($(selector));
|
|
4
6
|
|
|
5
7
|
const is404 = () => document.title.startsWith("Page not found · GitHub");
|
|
6
8
|
|
|
@@ -162,7 +164,9 @@ const isOpenPR = () => exists('#partial-discussion-header [title="Status: Open"]
|
|
|
162
164
|
|
|
163
165
|
const isMergedPR = () => exists('#partial-discussion-header [title="Status: Merged"]');
|
|
164
166
|
|
|
165
|
-
const
|
|
167
|
+
const isClosedConversation = () => exists('#partial-discussion-header :is([title="Status: Closed"], [title="Status: Merged"], [title="Status: Closed as not planned"])');
|
|
168
|
+
|
|
169
|
+
const isClosedPR = isClosedConversation;
|
|
166
170
|
|
|
167
171
|
const isReleases = (url = location) => {
|
|
168
172
|
var _a;
|
|
@@ -210,6 +214,8 @@ const isEmptyRepoRoot = () => isRepoHome() && !exists('link[rel="canonical"]');
|
|
|
210
214
|
|
|
211
215
|
const isEmptyRepo = () => exists('[aria-label="Cannot fork because repository is empty."]');
|
|
212
216
|
|
|
217
|
+
const isArchivedRepo = () => Boolean(isRepo() && $("#repository-container-header .Label").textContent.endsWith("archive"));
|
|
218
|
+
|
|
213
219
|
const isBlank = () => exists("main .blankslate");
|
|
214
220
|
|
|
215
221
|
const isRepoTaxonomyConversationList = (url = location) => {
|
|
@@ -310,6 +316,8 @@ const isProfile = (url = location) => {
|
|
|
310
316
|
|
|
311
317
|
const isUserProfile = () => isProfile() && !isOrganizationProfile();
|
|
312
318
|
|
|
319
|
+
const isPrivateUserProfile = () => isUserProfile() && !exists(".user-following-container");
|
|
320
|
+
|
|
313
321
|
const isUserProfileMainTab = () => isUserProfile() && !new URLSearchParams(location.search).has("tab");
|
|
314
322
|
|
|
315
323
|
const isUserProfileRepoTab = (url = location) => isProfile(url) && "repositories" === new URLSearchParams(url.search).get("tab");
|
|
@@ -392,4 +400,4 @@ const utils = {
|
|
|
392
400
|
getRepositoryInfo: getRepo
|
|
393
401
|
};
|
|
394
402
|
|
|
395
|
-
export { canUserEditOrganization, canUserEditRepo, hasCode, hasComments, hasFileEditor, hasFiles, hasReleaseEditor, hasRichTextEditor, hasWikiPageEditor, is404, is500, isActionJobRun, isActionRun, isBlame, isBlank, isBranches, isClosedPR, isCommit, isCommitList, isCompare, isCompareWikiPage, isConversation, isConversationList, isDashboard, isDeletingFile, isDiscussion, isDiscussionList, isDraftPR, isEditingFile, isEditingRelease, isEditingWikiPage, isEmptyRepo, isEmptyRepoRoot, isEnterprise, isFileFinder, isForkedRepo, isGist, isGistRevision, isGlobalConversationList, isGlobalSearchResults, isIssue, isLabelList, isMarketplaceAction, isMergedPR, isMilestone, isMilestoneList, isNewAction, isNewFile, isNewIssue, isNewRelease, isNewRepo, isNewRepoTemplate, isNewWikiPage, isNotifications, isOpenPR, isOrganizationDiscussion, isOrganizationProfile, isOrganizationRepo, isOwnOrganizationProfile, isOwnUserProfile, isPR, isPRCommit, isPRCommit404, isPRCommitList, isPRConflicts, isPRConversation, isPRFile404, isPRFiles, isPRList, isPasswordConfirmation, isProfile, isProject, isProjects, isQuickPR, isReleases, isReleasesOrTags, isRepliesSettings, isRepo, isRepoCommitList, isRepoConversationList, isRepoForksList, isRepoHome, isRepoIssueList, isRepoMainSettings, isRepoNetworkGraph, isRepoPRList, isRepoRoot, isRepoSearch, isRepoSettings, isRepoTaxonomyConversationList, isRepoTree, isRepoWiki, isRepositoryActions, isSingleCommit, isSingleFile, isSingleGist, isSingleTag, isTags, isTrending, isUserProfile, isUserProfileFollowersTab, isUserProfileFollowingTab, isUserProfileMainTab, isUserProfileRepoTab, isUserProfileStarsTab, isUserSettings, isUserTheOrganizationOwner, utils };
|
|
403
|
+
export { canUserEditOrganization, canUserEditRepo, hasCode, hasComments, hasFileEditor, hasFiles, hasReleaseEditor, hasRichTextEditor, hasWikiPageEditor, is404, is500, isActionJobRun, isActionRun, isArchivedRepo, isBlame, isBlank, isBranches, isClosedConversation, isClosedPR, isCommit, isCommitList, isCompare, isCompareWikiPage, isConversation, isConversationList, isDashboard, isDeletingFile, isDiscussion, isDiscussionList, isDraftPR, isEditingFile, isEditingRelease, isEditingWikiPage, isEmptyRepo, isEmptyRepoRoot, isEnterprise, isFileFinder, isForkedRepo, isGist, isGistRevision, isGlobalConversationList, isGlobalSearchResults, isIssue, isLabelList, isMarketplaceAction, isMergedPR, isMilestone, isMilestoneList, isNewAction, isNewFile, isNewIssue, isNewRelease, isNewRepo, isNewRepoTemplate, isNewWikiPage, isNotifications, isOpenPR, isOrganizationDiscussion, isOrganizationProfile, isOrganizationRepo, isOwnOrganizationProfile, isOwnUserProfile, isPR, isPRCommit, isPRCommit404, isPRCommitList, isPRConflicts, isPRConversation, isPRFile404, isPRFiles, isPRList, isPasswordConfirmation, isPrivateUserProfile, isProfile, isProject, isProjects, isQuickPR, isReleases, isReleasesOrTags, isRepliesSettings, isRepo, isRepoCommitList, isRepoConversationList, isRepoForksList, isRepoHome, isRepoIssueList, isRepoMainSettings, isRepoNetworkGraph, isRepoPRList, isRepoRoot, isRepoSearch, isRepoSettings, isRepoTaxonomyConversationList, isRepoTree, isRepoWiki, isRepositoryActions, isSingleCommit, isSingleFile, isSingleGist, isSingleTag, isTags, isTrending, isUserProfile, isUserProfileFollowersTab, isUserProfileFollowingTab, isUserProfileMainTab, isUserProfileRepoTab, isUserProfileStarsTab, isUserSettings, isUserTheOrganizationOwner, utils };
|