Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,12 @@ TEST: addTests('isRepo', [
export const hasRepoHeader = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepo(url) && !isRepoSearch(url);
TEST: addTests('hasRepoHeader', combinedTestOnly);

// On empty repos, there's only isRepoHome; this element is found in `<head>`
export const isEmptyRepoRoot = (): boolean => isRepoHome() && !exists('link[rel="canonical"]');
export const isEmptyRepoRoot = (): boolean => isRepoHome() && exists([
// If you don't have write access
'.blankslate-icon',
// If you have write access
'#empty-setup-clone-url',
].join(','));

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

Expand Down