MCPcopy Create free account
hub / github.com/subquery/subql / updateDataSourcesEntry

Function updateDataSourcesEntry

packages/node-core/src/utils/project.ts:161–172  ·  view source on GitHub ↗
(
  reader: Reader,
  file: string,
  root: string,
  script: string
)

Source from the content-addressed store, hash-verified

159}
160
161export async function updateDataSourcesEntry(
162 reader: Reader,
163 file: string,
164 root: string,
165 script: string
166): Promise<string> {
167 if (reader instanceof LocalReader) return file;
168 else if (reader instanceof IPFSReader || reader instanceof GithubReader) {
169 return saveFile(reader, root, file, script);
170 }
171 throw new Error('Un-known reader type');
172}
173
174export async function updateProcessor(reader: Reader, root: string, file: string): Promise<string> {
175 if (reader instanceof LocalReader) {

Callers 1

updateDataSourcesV1_0_0Function · 0.85

Calls 1

saveFileFunction · 0.85

Tested by

no test coverage detected