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

Function getFileContent

packages/common/src/project/load.ts:75–87  ·  view source on GitHub ↗
(path: string, identifier: string)

Source from the content-addressed store, hash-verified

73 * @returns file content
74 */
75export function getFileContent(path: string, identifier: string): string {
76 if (!fs.existsSync(path)) {
77 const err_msg = `${identifier} file ${path} is does not exist`;
78 throw new Error(err_msg);
79 }
80
81 try {
82 return fs.readFileSync(path).toString();
83 } catch (error) {
84 const err_msg = `Failed to load ${identifier} file, ${error}`;
85 throw new Error(err_msg);
86 }
87}
88
89// Validate generic/common section for project manifest
90export function validateCommonProjectManifest(raw: unknown): void {

Callers 4

postgresCACertMethod · 0.90
postgresClientKeyMethod · 0.90
postgresClientCertMethod · 0.90
dbSslOptionMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected