| 361 | { parseText = true, branch = this.branch, lfs = false } = {}, |
| 362 | ): Promise<string | Blob> => { |
| 363 | const fetchContent = async () => { |
| 364 | const content = await this.request({ |
| 365 | url: `${this.repoURL}/repository/files/${encodeURIComponent(path)}/raw`, |
| 366 | params: { ref: branch, ...(lfs ? { lfs: true } : {}) }, |
| 367 | cache: 'no-store', |
| 368 | }).then<Blob | string>(parseText ? this.responseToText : this.responseToBlob); |
| 369 | return content; |
| 370 | }; |
| 371 | |
| 372 | const cacheKey = sha && lfs ? `${sha}.lfs` : sha; |
| 373 | const content = await readFile(cacheKey, fetchContent, localForage, parseText); |