(
path: string,
sha: string | null | undefined,
{ branch = this.branch } = {},
)
| 316 | }; |
| 317 | |
| 318 | async readFileMetadata( |
| 319 | path: string, |
| 320 | sha: string | null | undefined, |
| 321 | { branch = this.branch } = {}, |
| 322 | ) { |
| 323 | const fetchFileMetadata = async () => { |
| 324 | try { |
| 325 | const { value } = await this.requestJSON<AzureArray<AzureCommit>>({ |
| 326 | url: `${this.endpointUrl}/commits/`, |
| 327 | params: { |
| 328 | 'searchCriteria.itemPath': path, |
| 329 | 'searchCriteria.itemVersion.version': branch, |
| 330 | 'searchCriteria.$top': 1, |
| 331 | }, |
| 332 | }); |
| 333 | const [commit] = value; |
| 334 | |
| 335 | return { |
| 336 | author: commit.author.name || commit.author.email, |
| 337 | updatedOn: commit.author.date, |
| 338 | }; |
| 339 | } catch (error) { |
| 340 | return { author: '', updatedOn: '' }; |
| 341 | } |
| 342 | }; |
| 343 | |
| 344 | const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage); |
| 345 | return fileMetadata; |
| 346 | } |
| 347 | |
| 348 | readFile = ( |
| 349 | path: string, |
nothing calls this directly
no test coverage detected