MCPcopy Create free account
hub / github.com/decaporg/decap-cms / fetchContent

Method fetchContent

packages/decap-cms-backend-gitlab/src/API.ts:363–370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected