mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: handle type errors
This commit is contained in:
parent
05507abbcb
commit
c1f8456e7f
1 changed files with 3 additions and 3 deletions
|
|
@ -7,8 +7,8 @@ import { CopyFileButton, copyFileButtonClassName } from './CopyFileButton'
|
|||
|
||||
export function resolveMeta(): Partial<MetaData> {
|
||||
const metaData = {
|
||||
userName: $('[itemprop="author"] > a[rel="author"]', e => e.textContent?.trim()),
|
||||
repoName: $('[itemprop="name"] > a[href]', e => e.textContent?.trim()),
|
||||
userName: $('[itemprop="author"] > a[rel="author"]', e => e.textContent?.trim()) || undefined,
|
||||
repoName: $('[itemprop="name"] > a[href]', e => e.textContent?.trim()) || undefined,
|
||||
branchName: getCurrentBranch(true),
|
||||
}
|
||||
if (!metaData.userName || !metaData.repoName) {
|
||||
|
|
@ -56,7 +56,7 @@ export function getCurrentBranch(passive = false) {
|
|||
|
||||
const findFileButtonSelector =
|
||||
'#js-repo-pjax-container .repository-content .file-navigation a[data-hotkey="t"]'
|
||||
const urlFromFindFileButton: string | undefined = $(
|
||||
const urlFromFindFileButton: string | null = $(
|
||||
findFileButtonSelector,
|
||||
element => (element as HTMLAnchorElement).href,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue