(path: string, sha: string | null | undefined)
| 691 | } |
| 692 | |
| 693 | async readFileMetadata(path: string, sha: string | null | undefined) { |
| 694 | const fetchFileMetadata = async () => { |
| 695 | try { |
| 696 | const result: Endpoints['GET /repos/{owner}/{repo}/commits']['response']['data'] = |
| 697 | await this.request(`${this.originRepoURL}/commits`, { |
| 698 | params: { path, sha: this.branch }, |
| 699 | }); |
| 700 | const { commit } = result[0]; |
| 701 | return { |
| 702 | author: commit.author?.name || commit.author?.email || '', |
| 703 | updatedOn: commit.author?.date || '', |
| 704 | }; |
| 705 | } catch (e) { |
| 706 | return { author: '', updatedOn: '' }; |
| 707 | } |
| 708 | }; |
| 709 | const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage); |
| 710 | return fileMetadata; |
| 711 | } |
| 712 | |
| 713 | async fetchBlobContent({ sha, repoURL, parseText }: BlobArgs) { |
| 714 | const result: Endpoints['GET /repos/{owner}/{repo}/git/blobs/{file_sha}']['response']['data'] = |
nothing calls this directly
no test coverage detected