MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / readFile

Function readFile

src/back/ServicesFile.ts:24–30  ·  view source on GitHub ↗
(jsonFolder: string, config: AppConfigData, onError?: (error: string) => void)

Source from the content-addressed store, hash-verified

22 * @param onError Called for each error that occurs while parsing.
23 */
24 export function readFile(jsonFolder: string, config: AppConfigData, onError?: (error: string) => void): Promise<ServiceFileData> {
25 return new Promise((resolve, reject) => {
26 readJsonFile(path.join(jsonFolder, filePath), fileEncoding)
27 .then(json => resolve(parseServiceFileData(json, config, onError)))
28 .catch(reject);
29 });
30 }
31
32 function parseServiceFileData(data: any, config: AppConfigData, onError?: (error: string) => void): ServiceFileData {
33 const parsed: ServiceFileData = {

Callers

nothing calls this directly

Calls 2

readJsonFileFunction · 0.90
parseServiceFileDataFunction · 0.85

Tested by

no test coverage detected