| 352 | { parseText = true, branch = this.branch, lfs = false } = {}, |
| 353 | ): Promise<string | Blob> => { |
| 354 | const fetchContent = async () => { |
| 355 | const content = await this.request({ |
| 356 | url: `${this.repoURL}/repository/files/${encodeURIComponent(path)}/raw`, |
| 357 | params: { ref: branch, ...(lfs ? { lfs: true } : {}) }, |
| 358 | cache: 'no-store', |
| 359 | }).then<Blob | string>(parseText ? this.responseToText : this.responseToBlob); |
| 360 | return content; |
| 361 | }; |
| 362 | |
| 363 | const cacheKey = sha && lfs ? `${sha}.lfs` : sha; |
| 364 | const content = await readFile(cacheKey, fetchContent, localForage, parseText); |