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