Skip to content

Commit

Permalink
Deprecate isEmptyRepo in favor of isEmptyRepoRoot
Browse files Browse the repository at this point in the history
The name makes it more clear that this only matches /user/repo/ URLs
  • Loading branch information
fregante committed May 21, 2020
1 parent 6e1b095 commit 0c36c4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ collect.set('isRepo', [
'https://github.com/sindresorhus/refined-github/issues/templates/edit', // Gotcha for isRepoIssueList
]);

/** @deprecated use isEmptyRepoRoot instead */
export const isEmptyRepo = (): boolean => isRepo() && exists('.blankslate');

export const isEmptyRepoRoot = (): boolean => isRepoRoot() && exists('.blankslate');

export const isRepoTaxonomyDiscussionList = (url: URL | Location = location): boolean => /^labels\/.+|^milestones\/\d+(?!\/edit)/.test(getRepoPath(url)!);
collect.set('isRepoTaxonomyDiscussionList', [
'https://github.com/sindresorhus/refined-github/labels/Priority%3A%20critical',
Expand Down Expand Up @@ -422,7 +425,7 @@ export const canUserEditOrganization = (): boolean => isOrganizationProfile() &&

export const canUserEditRepo = (): boolean => isRepo() && exists('.reponav-item[href$="/settings"]');

/** @deprecated use canUserEditRepo */
/** @deprecated use canUserEditRepo instead */
export const isRepoWithAccess = canUserEditRepo;

const getUsername = () => document.querySelector('meta[name="user-login"]')!.getAttribute('content')!;
Expand Down

0 comments on commit 0c36c4c

Please sign in to comment.