MCPcopy Create free account
hub / github.com/NiladriHazra/WhatToBuild / getRepositoryContents

Method getRepositoryContents

lib/github.ts:130–141  ·  view source on GitHub ↗
(owner: string, repo: string, path = '')

Source from the content-addressed store, hash-verified

128 }
129
130 async getRepositoryContents(owner: string, repo: string, path = ''): Promise<RepoContent[]> {
131 try {
132 const response = await axios.get(`${this.baseURL}/repos/${owner}/${repo}/contents/${path}`, {
133 headers: this.getHeaders()
134 });
135
136 return Array.isArray(response.data) ? response.data : [response.data];
137 } catch (error) {
138 console.error('GitHub contents error:', error);
139 return [];
140 }
141 }
142
143 async getFileContent(owner: string, repo: string, path: string): Promise<string | null> {
144 try {

Callers 1

analyzeRepositoryMethod · 0.95

Calls 1

getHeadersMethod · 0.95

Tested by

no test coverage detected