Skip to content

Commit 12c7c07

Browse files
yakov116fregante
andauthored
Add isNewRepo (#33)
Co-authored-by: Federico <me@fregante.com>
1 parent e1f18ca commit 12c7c07

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,11 @@ export const canUserEditOrganization = (): boolean => isOrganizationProfile() &&
459459

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

462+
export const isNewRepo = (url: URL | Location = location): boolean => url.pathname === '/new';
463+
collect.set('isNewRepo', [
464+
'https://github.com/new',
465+
]);
466+
462467
/** Get the logged-in user’s username */
463468
const getUsername = () => document.querySelector('meta[name="user-login"]')!.getAttribute('content')!;
464469

0 commit comments

Comments
 (0)