Skip to content

Commit

Permalink
Add isNewRepo (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: Federico <me@fregante.com>
  • Loading branch information
yakov116 and fregante committed Sep 10, 2020
1 parent e1f18ca commit 12c7c07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ export const canUserEditOrganization = (): boolean => isOrganizationProfile() &&

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

export const isNewRepo = (url: URL | Location = location): boolean => url.pathname === '/new';
collect.set('isNewRepo', [
'https://github.com/new',
]);

/** Get the logged-in user’s username */
const getUsername = () => document.querySelector('meta[name="user-login"]')!.getAttribute('content')!;

Expand Down

0 comments on commit 12c7c07

Please sign in to comment.