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

Method fetchFileMetadata

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected