We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9abf86 commit 926600eCopy full SHA for 926600e
index.ts
@@ -574,7 +574,7 @@ collect.set('isNewRepoTemplate', [
574
]);
575
576
/** Get the logged-in user’s username */
577
-const getUsername = () => document.querySelector('meta[name="user-login"]')!.getAttribute('content')!;
+const getUsername = (): string | undefined => document.querySelector('meta[name="user-login"]')?.getAttribute('content')!;
578
579
/** Drop leading and trailing slashes */
580
const getCleanPathname = (url: URL | HTMLAnchorElement | Location = location): string => url.pathname.slice(1, url.pathname.endsWith('/') ? -1 : undefined);
0 commit comments