(path: string, sha: string | null | undefined)
| 366 | }; |
| 367 | |
| 368 | async readFileMetadata(path: string, sha: string | null | undefined) { |
| 369 | const fetchFileMetadata = async () => { |
| 370 | try { |
| 371 | const result: GitLabCommit[] = await this.requestJSON({ |
| 372 | url: `${this.repoURL}/repository/commits`, |
| 373 | params: { path, ref_name: this.branch }, |
| 374 | }); |
| 375 | const commit = result[0]; |
| 376 | return { |
| 377 | author: commit.author_name || commit.author_email, |
| 378 | updatedOn: commit.authored_date, |
| 379 | }; |
| 380 | } catch (e) { |
| 381 | return { author: '', updatedOn: '' }; |
| 382 | } |
| 383 | }; |
| 384 | const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage); |
| 385 | return fileMetadata; |
| 386 | } |
| 387 | |
| 388 | getCursorFromHeaders = (headers: Headers) => { |
| 389 | const page = parseInt(headers.get('X-Page') as string, 10); |
nothing calls this directly
no test coverage detected