(
path: string,
sha?: string | null,
{
branch = this.branch,
repoURL = this.repoURL,
parseText = true,
}: {
branch?: string;
repoURL?: string;
parseText?: boolean;
} = {},
)
| 241 | } |
| 242 | |
| 243 | async readFile( |
| 244 | path: string, |
| 245 | sha?: string | null, |
| 246 | { |
| 247 | branch = this.branch, |
| 248 | repoURL = this.repoURL, |
| 249 | parseText = true, |
| 250 | }: { |
| 251 | branch?: string; |
| 252 | repoURL?: string; |
| 253 | parseText?: boolean; |
| 254 | } = {}, |
| 255 | ) { |
| 256 | if (!sha) { |
| 257 | sha = await this.getFileSha(path, { repoURL, branch }); |
| 258 | } |
| 259 | const fetchContent = () => this.fetchBlobContent({ sha: sha as string, repoURL, parseText }); |
| 260 | const content = await readFile(sha, fetchContent, localForage, parseText); |
| 261 | return content; |
| 262 | } |
| 263 | |
| 264 | async fetchBlobContent({ sha, repoURL, parseText }: BlobArgs) { |
| 265 | if (!parseText) { |
nothing calls this directly
no test coverage detected