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

Function parseMetaEdit

src/back/MetaEdit.ts:16–31  ·  view source on GitHub ↗
(data: any, onError?: (error: string) => void)

Source from the content-addressed store, hash-verified

14const { str } = Coerce;
15
16export function parseMetaEdit(data: any, onError?: (error: string) => void): MetaEditFile {
17 const parser = new ObjectParser({
18 input: data,
19 onError: onError && ((e) => { onError(`Error while parsing Exec Mappings: ${e.toString()}`); })
20 });
21
22 const parsed: MetaEditFile = {
23 metas: [],
24 launcherVersion: '',
25 };
26
27 parser.prop('metas').array(v => parsed.metas.push(parseMetaEditMeta(v)));
28 parser.prop('launcherVersion', v => parsed.launcherVersion = str(v));
29
30 return parsed;
31}
32
33function parseMetaEditMeta(parser: IObjectParserProp<any>) : MetaEditMeta {
34 const parsed: MetaEditMeta = {

Callers 1

importAllMetaEditsFunction · 0.85

Calls 7

parseMetaEditMetaFunction · 0.85
strFunction · 0.85
onErrorFunction · 0.70
toStringMethod · 0.65
arrayMethod · 0.65
propMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected