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

Method fetchContent

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected