Skip to content

Commit 34f422d

Browse files
authored
Add isPublicRepo (#140)
1 parent e83cf88 commit 34f422d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ export const isEmptyRepoRoot = (): boolean => isRepoHome() && !exists('link[rel=
360360

361361
export const isEmptyRepo = (): boolean => exists('[aria-label="Cannot fork because repository is empty."]');
362362

363+
export const isPublicRepo = (): boolean => Boolean(isRepo() && $('#repository-container-header .Label')!.textContent!.startsWith('Public'));
364+
363365
export const isArchivedRepo = (): boolean => Boolean(isRepo() && $('#repository-container-header .Label')!.textContent!.endsWith('archive'));
364366

365367
export const isBlank = (): boolean => exists('main .blankslate');

0 commit comments

Comments
 (0)