github-url-detection 6.0.0 → 6.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.
- package/distribution/index.d.ts +131 -0
- package/package.json +2 -2
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export declare const is404: () => boolean;
|
|
2
|
+
export declare const is500: () => boolean;
|
|
3
|
+
export declare const isPasswordConfirmation: () => boolean;
|
|
4
|
+
export declare const isBlame: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
5
|
+
export declare const isCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
6
|
+
export declare const isCommitList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
7
|
+
export declare const isRepoCommitList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
8
|
+
export declare const isCompare: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
9
|
+
export declare const isCompareWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
10
|
+
export declare const isDashboard: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
11
|
+
export declare const isEnterprise: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
12
|
+
export declare const isGist: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
13
|
+
export declare const isGlobalIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
14
|
+
export declare const isGlobalSearchResults: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
15
|
+
export declare const isIssue: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
16
|
+
export declare const isIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
17
|
+
export declare const isConversation: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
18
|
+
export declare const isLabelList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
19
|
+
export declare const isMilestone: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
20
|
+
export declare const isMilestoneList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
21
|
+
export declare const isNewFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
22
|
+
export declare const isNewIssue: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
23
|
+
export declare const isNewRelease: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
24
|
+
export declare const isNewWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
25
|
+
export declare const isNotifications: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
26
|
+
export declare const isOrganizationProfile: () => boolean;
|
|
27
|
+
export declare const isOrganizationRepo: () => boolean;
|
|
28
|
+
export declare const isTeamDiscussion: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
29
|
+
export declare const isOwnUserProfile: () => boolean;
|
|
30
|
+
export declare const isOwnOrganizationProfile: () => boolean;
|
|
31
|
+
export declare const isProject: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
32
|
+
export declare const isProjects: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
33
|
+
export declare const isDiscussion: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
34
|
+
export declare const isDiscussionList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
35
|
+
export declare const isPR: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
36
|
+
export declare const isPRConflicts: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
37
|
+
/** 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 */
|
|
38
|
+
export declare const isPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
39
|
+
export declare const isPRCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
40
|
+
export declare const isPRCommit404: () => boolean;
|
|
41
|
+
export declare const isPRFile404: () => boolean;
|
|
42
|
+
export declare const isPRConversation: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
43
|
+
export declare const isPRCommitList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
44
|
+
export declare const isPRFiles: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
45
|
+
export declare const isQuickPR: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
46
|
+
export declare const isDraftPR: () => boolean;
|
|
47
|
+
export declare const isOpenPR: () => boolean;
|
|
48
|
+
export declare const isMergedPR: () => boolean;
|
|
49
|
+
export declare const isClosedPR: () => boolean;
|
|
50
|
+
export declare const isClosedIssue: () => boolean;
|
|
51
|
+
export declare const isReleases: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
52
|
+
export declare const isTags: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
53
|
+
export declare const isSingleTag: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
54
|
+
export declare const isReleasesOrTags: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
55
|
+
export declare const isDeletingFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
56
|
+
export declare const isEditingFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
57
|
+
export declare const hasFileEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
58
|
+
export declare const isEditingRelease: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
59
|
+
export declare const hasReleaseEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
60
|
+
export declare const isEditingWikiPage: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
61
|
+
export declare const hasWikiPageEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
62
|
+
export declare const isRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
63
|
+
export declare const hasRepoHeader: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
64
|
+
export declare const isEmptyRepoRoot: () => boolean;
|
|
65
|
+
export declare const isEmptyRepo: () => boolean;
|
|
66
|
+
export declare const isArchivedRepo: () => boolean;
|
|
67
|
+
export declare const isBlank: () => boolean;
|
|
68
|
+
export declare const isRepoTaxonomyIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
69
|
+
export declare const isRepoIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
70
|
+
export declare const isRepoPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
71
|
+
export declare const isRepoIssueList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
72
|
+
export declare const isRepoHome: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
73
|
+
export declare const isRepoRoot: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
74
|
+
export declare const isRepoSearch: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
75
|
+
export declare const isRepoSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
76
|
+
export declare const isRepoMainSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
77
|
+
export declare const isRepliesSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
78
|
+
export declare const isUserSettings: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
79
|
+
export declare const isRepoTree: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
80
|
+
export declare const isRepoWiki: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
81
|
+
export declare const isSingleCommit: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
82
|
+
export declare const isSingleFile: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
83
|
+
export declare const isFileFinder: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
84
|
+
export declare const isRepoForksList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
85
|
+
export declare const isRepoNetworkGraph: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
86
|
+
export declare const isForkedRepo: () => boolean;
|
|
87
|
+
export declare const isSingleGist: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
88
|
+
export declare const isGistRevision: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
89
|
+
export declare const isTrending: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
90
|
+
export declare const isBranches: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
91
|
+
export declare const isProfile: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
92
|
+
export declare const isGistProfile: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
93
|
+
export declare const isUserProfile: () => boolean;
|
|
94
|
+
export declare const isPrivateUserProfile: () => boolean;
|
|
95
|
+
export declare const isUserProfileMainTab: () => boolean;
|
|
96
|
+
export declare const isUserProfileRepoTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
97
|
+
export declare const isUserProfileStarsTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
98
|
+
export declare const isUserProfileFollowersTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
99
|
+
export declare const isUserProfileFollowingTab: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
100
|
+
export declare const hasComments: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
101
|
+
export declare const hasRichTextEditor: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
102
|
+
/** Static code, not the code editor */
|
|
103
|
+
export declare const hasCode: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
104
|
+
/** Has a list of files */
|
|
105
|
+
export declare const hasFiles: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
106
|
+
export declare const isMarketplaceAction: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
107
|
+
export declare const isActionJobRun: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
108
|
+
export declare const isActionRun: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
109
|
+
export declare const isNewAction: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
110
|
+
export declare const isRepositoryActions: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
111
|
+
export declare const isUserTheOrganizationOwner: () => boolean;
|
|
112
|
+
export declare const canUserEditRepo: () => boolean;
|
|
113
|
+
export declare const isNewRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
114
|
+
export declare const isNewRepoTemplate: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
115
|
+
export interface RepositoryInfo {
|
|
116
|
+
owner: string;
|
|
117
|
+
name: string;
|
|
118
|
+
/** The 'user/repo' part from an URL */
|
|
119
|
+
nameWithOwner: string;
|
|
120
|
+
/** A repo's subpage
|
|
121
|
+
@example '/user/repo/issues/' -> 'issues'
|
|
122
|
+
@example '/user/repo/' -> ''
|
|
123
|
+
@example '/settings/token/' -> undefined */
|
|
124
|
+
path: string;
|
|
125
|
+
}
|
|
126
|
+
export declare const utils: {
|
|
127
|
+
getUsername: () => string | undefined;
|
|
128
|
+
getCleanPathname: (url?: URL | HTMLAnchorElement | Location) => string;
|
|
129
|
+
getCleanGistPathname: (url?: URL | HTMLAnchorElement | Location) => string | undefined;
|
|
130
|
+
getRepositoryInfo: (url?: URL | HTMLAnchorElement | Location | string) => RepositoryInfo | undefined;
|
|
131
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-url-detection",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"demo:build": "vite build demo --config demo/vite.config.js",
|
|
31
31
|
"demo:test": "svelte-check",
|
|
32
32
|
"demo:watch": "vite serve demo --config demo/vite.config.js",
|
|
33
|
-
"prepack": "
|
|
33
|
+
"prepack": "npm run build",
|
|
34
34
|
"test": "run-p build ava xo",
|
|
35
35
|
"watch": "run-p watch:typescript demo:watch # vite watch doesn’t generate the lib, so just use the demo",
|
|
36
36
|
"watch:typescript": "tsc --watch --noEmit",
|