MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / parseProgram

Function parseProgram

src/lib/prettierFormatter.js:297–311  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

295}
296
297function parseProgram(source) {
298 try {
299 return parse(source, {
300 ecmaVersion: "latest",
301 sourceType: "module",
302 allowHashBang: true,
303 });
304 } catch (_) {
305 return parse(source, {
306 ecmaVersion: "latest",
307 sourceType: "script",
308 allowHashBang: true,
309 });
310 }
311}
312
313function extractConfigFromProgram(source) {
314 const ast = parseProgram(source);

Callers 1

extractConfigFromProgramFunction · 0.85

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected