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

Function readFile

src/renderer/upgrade/UpgradeFile.ts:21–27  ·  view source on GitHub ↗
(jsonFolder: string, onError?: (error: string) => void)

Source from the content-addressed store, hash-verified

19 * @param onError Called for each error that occurs while parsing.
20 */
21 export function readFile(jsonFolder: string, onError?: (error: string) => void): Promise<UpgradeStage[]> {
22 return new Promise((resolve, reject) => {
23 readJsonFile(path.join(jsonFolder, filePath), fileEncoding)
24 .then(json => resolve(parseFile(json, onError)))
25 .catch(reject);
26 });
27 }
28
29 function parseFile(data: any, onError?: (error: string) => void): UpgradeStage[] {
30 const parser = new ObjectParser({

Callers

nothing calls this directly

Calls 2

readJsonFileFunction · 0.90
parseFileFunction · 0.85

Tested by

no test coverage detected