github-url-detection 10.2.0 → 10.2.2
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 +1 -1
- package/distribution/index.js +3 -3
- package/package.json +1 -1
package/distribution/index.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export declare const isRepoFile404: (url?: URL | HTMLAnchorElement | Location) =
|
|
|
96
96
|
export declare const isRepoForksList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
97
97
|
export declare const isRepoNetworkGraph: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
98
98
|
export declare const isForkedRepo: () => boolean;
|
|
99
|
-
export declare const
|
|
99
|
+
export declare const isForkingRepo: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
100
100
|
export declare const isSingleGist: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
101
101
|
export declare const isGistRevision: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
102
102
|
export declare const isTrending: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
package/distribution/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var isDiscussionList = (url = location) => getRepo(url)?.path === "discussions"
|
|
|
41
41
|
var isPR = (url = location) => /^pull\/\d+/.test(getRepo(url)?.path) && !isPRConflicts(url);
|
|
42
42
|
var isPRConflicts = (url = location) => /^pull\/\d+\/conflicts/.test(getRepo(url)?.path);
|
|
43
43
|
var isPRList = (url = location) => url.pathname === "/pulls" || getRepo(url)?.path === "pulls";
|
|
44
|
-
var isPRCommit = (url = location) => /^pull\/\d+\/commits\/[\da-f]{
|
|
44
|
+
var isPRCommit = (url = location) => /^pull\/\d+\/(commits|changes)\/[\da-f]{7,40}$/.test(getRepo(url)?.path);
|
|
45
45
|
var isPRCommit404 = () => isPRCommit() && document.title.startsWith("Commit range not found \xB7 Pull Request");
|
|
46
46
|
var isPRFile404 = () => isPRFiles() && document.title.startsWith("Commit range not found \xB7 Pull Request");
|
|
47
47
|
var isPRConversation = (url = location) => /^pull\/\d+$/.test(getRepo(url)?.path);
|
|
@@ -149,7 +149,7 @@ var isRepoFile404 = (url = location) => (isSingleFile(url) || isRepoTree(url)) &
|
|
|
149
149
|
var isRepoForksList = (url = location) => getRepo(url)?.path === "network/members";
|
|
150
150
|
var isRepoNetworkGraph = (url = location) => getRepo(url)?.path === "network";
|
|
151
151
|
var isForkedRepo = () => exists('meta[name="octolytics-dimension-repository_is_fork"][content="true"]');
|
|
152
|
-
var
|
|
152
|
+
var isForkingRepo = (url = location) => getRepo(url)?.path === "fork";
|
|
153
153
|
var isSingleGist = (url = location) => /^[^/]+\/[\da-f]{20,32}(\/[\da-f]{40})?$/.test(getCleanGistPathname(url));
|
|
154
154
|
var isGistRevision = (url = location) => /^[^/]+\/[\da-f]{20,32}\/revisions$/.test(getCleanGistPathname(url));
|
|
155
155
|
var isTrending = (url = location) => url.pathname === "/trending" || url.pathname.startsWith("/trending/");
|
|
@@ -268,8 +268,8 @@ export {
|
|
|
268
268
|
isEmptyRepoRoot,
|
|
269
269
|
isEnterprise,
|
|
270
270
|
isFileFinder,
|
|
271
|
-
isFork,
|
|
272
271
|
isForkedRepo,
|
|
272
|
+
isForkingRepo,
|
|
273
273
|
isGist,
|
|
274
274
|
isGistProfile,
|
|
275
275
|
isGistRevision,
|