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

Method fetchFileMetadata

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

Source from the content-addressed store, hash-verified

692
693 async readFileMetadata(path: string, sha: string | null | undefined) {
694 const fetchFileMetadata = async () => {
695 try {
696 const result: Endpoints['GET /repos/{owner}/{repo}/commits']['response']['data'] =
697 await this.request(`${this.originRepoURL}/commits`, {
698 params: { path, sha: this.branch },
699 });
700 const { commit } = result[0];
701 return {
702 author: commit.author?.name || commit.author?.email || '',
703 updatedOn: commit.author?.date || '',
704 };
705 } catch (e) {
706 return { author: '', updatedOn: '' };
707 }
708 };
709 const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage);
710 return fileMetadata;
711 }

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected