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

Function parseFile

src/renderer/upgrade/UpgradeFile.ts:29–39  ·  view source on GitHub ↗
(data: any, onError?: (error: string) => void)

Source from the content-addressed store, hash-verified

27 }
28
29 function parseFile(data: any, onError?: (error: string) => void): UpgradeStage[] {
30 const parser = new ObjectParser({
31 input: data,
32 onError: onError && (e => { onError(`Error while parsing Upgrades: ${e.toString()}`); })
33 });
34 const stages: UpgradeStage[] = [];
35 for (const key in data) {
36 stages.push(parseUpgradeStage(parser.prop(key), key, onError));
37 }
38 return stages;
39 }
40
41 function parseUpgradeStage(parser: IObjectParserProp<any>, key: string, onError?: (error: string) => void): UpgradeStage {
42 const parsed: UpgradeStage = {

Callers 1

readFileFunction · 0.85

Calls 5

parseUpgradeStageFunction · 0.85
toStringMethod · 0.65
pushMethod · 0.65
propMethod · 0.65
onErrorFunction · 0.50

Tested by

no test coverage detected