github-url-detection 7.1.0 → 7.1.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 +4 -0
- package/distribution/index.js +2 -1
- package/package.json +1 -1
package/distribution/index.d.ts
CHANGED
|
@@ -125,6 +125,10 @@ export type RepositoryInfo = {
|
|
|
125
125
|
path: string;
|
|
126
126
|
};
|
|
127
127
|
export declare const utils: {
|
|
128
|
+
getOrg: (url?: URL | HTMLAnchorElement | Location) => {
|
|
129
|
+
name: string;
|
|
130
|
+
path: string;
|
|
131
|
+
} | undefined;
|
|
128
132
|
getUsername: () => string | undefined;
|
|
129
133
|
getCleanPathname: (url?: URL | HTMLAnchorElement | Location) => string;
|
|
130
134
|
getCleanGistPathname: (url?: URL | HTMLAnchorElement | Location) => string | undefined;
|
package/distribution/index.js
CHANGED
|
@@ -344,7 +344,7 @@ const isEmptyRepoRoot = () => isRepoHome() && !exists('link[rel="canonical"]');
|
|
|
344
344
|
const isEmptyRepo = () => exists('[aria-label="Cannot fork because repository is empty."]');
|
|
345
345
|
const isPublicRepo = () => exists('meta[name="octolytics-dimension-repository_public"][content="true"]');
|
|
346
346
|
const isArchivedRepo = () => Boolean(isRepo() && $("main > .flash-warn")?.textContent.includes("archived"));
|
|
347
|
-
const isBlank = () => exists("main .blankslate");
|
|
347
|
+
const isBlank = () => exists("main .blankslate:not([hidden] .blankslate)");
|
|
348
348
|
const isRepoTaxonomyIssueOrPRList = (url = location) => /^labels\/.+|^milestones\/\d+(?!\/edit)/.test(getRepo(url)?.path);
|
|
349
349
|
const isRepoIssueOrPRList = (url = location) => isRepoPRList(url) || isRepoIssueList(url) || isRepoTaxonomyIssueOrPRList(url);
|
|
350
350
|
const isRepoPRList = (url = location) => Boolean(getRepo(url)?.path.startsWith("pulls"));
|
|
@@ -448,6 +448,7 @@ const getRepo = (url) => {
|
|
|
448
448
|
};
|
|
449
449
|
};
|
|
450
450
|
const utils = {
|
|
451
|
+
getOrg,
|
|
451
452
|
getUsername,
|
|
452
453
|
getCleanPathname,
|
|
453
454
|
getCleanGistPathname,
|