MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / readFileJSON

Method readFileJSON

tools/mcpack.js:325–338  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

323 return path;
324 }
325 readFileJSON(path) {
326 let buffer = this.readFileString(path);
327 try {
328 return JSON.parse(buffer);
329 }
330 catch (e) {
331 let message = e.toString();
332 let result = /SyntaxError: ([^:]+: )?([0-9]+): (.+)/.exec(message);
333 if (result.length == 4) {
334 this.reportError(path, parseInt(result[2]), result[3]);
335 }
336 throw e;
337 }
338 }
339 writeDirectoryFileString(path, name, string) {
340 let segments = name.split('/');
341 if (segments.length > 1)

Callers 2

READ_PACKAGE_JSONMethod · 0.80
parseManifestMethod · 0.80

Calls 2

parseMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected