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

Method fetchFileMetadata

packages/decap-cms-backend-github/src/API.ts:666–680  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

664
665 async readFileMetadata(path: string, sha: string | null | undefined) {
666 const fetchFileMetadata = async () => {
667 try {
668 const result: Endpoints['GET /repos/{owner}/{repo}/commits']['response']['data'] =
669 await this.request(`${this.originRepoURL}/commits`, {
670 params: { path, sha: this.branch },
671 });
672 const { commit } = result[0];
673 return {
674 author: commit.author?.name || commit.author?.email || '',
675 updatedOn: commit.author?.date || '',
676 };
677 } catch (e) {
678 return { author: '', updatedOn: '' };
679 }
680 };
681 const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage);
682 return fileMetadata;
683 }

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected