github-url-detection 6.0.2 → 6.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.
- package/distribution/index.d.ts +1 -0
- package/distribution/index.js +2 -0
- package/package.json +1 -1
package/distribution/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare const isRepo: (url?: URL | HTMLAnchorElement | Location) => boole
|
|
|
63
63
|
export declare const hasRepoHeader: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
|
64
64
|
export declare const isEmptyRepoRoot: () => boolean;
|
|
65
65
|
export declare const isEmptyRepo: () => boolean;
|
|
66
|
+
export declare const isPublicRepo: () => boolean;
|
|
66
67
|
export declare const isArchivedRepo: () => boolean;
|
|
67
68
|
export declare const isBlank: () => boolean;
|
|
68
69
|
export declare const isRepoTaxonomyIssueOrPRList: (url?: URL | HTMLAnchorElement | Location) => boolean;
|
package/distribution/index.js
CHANGED
|
@@ -342,6 +342,7 @@ const isRepo = (url = location) => /^[^/]+\/[^/]+/.test(getCleanPathname(url)) &
|
|
|
342
342
|
const hasRepoHeader = (url = location) => isRepo(url) && !isRepoSearch(url);
|
|
343
343
|
const isEmptyRepoRoot = () => isRepoHome() && !exists('link[rel="canonical"]');
|
|
344
344
|
const isEmptyRepo = () => exists('[aria-label="Cannot fork because repository is empty."]');
|
|
345
|
+
const isPublicRepo = () => Boolean(isRepo() && $("#repository-container-header .Label").textContent.startsWith("Public"));
|
|
345
346
|
const isArchivedRepo = () => Boolean(isRepo() && $("#repository-container-header .Label").textContent.endsWith("archive"));
|
|
346
347
|
const isBlank = () => exists("main .blankslate");
|
|
347
348
|
const isRepoTaxonomyIssueOrPRList = (url = location) => /^labels\/.+|^milestones\/\d+(?!\/edit)/.test(getRepo(url)?.path);
|
|
@@ -519,6 +520,7 @@ export {
|
|
|
519
520
|
isProfile,
|
|
520
521
|
isProject,
|
|
521
522
|
isProjects,
|
|
523
|
+
isPublicRepo,
|
|
522
524
|
isQuickPR,
|
|
523
525
|
isReleases,
|
|
524
526
|
isReleasesOrTags,
|