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

Function parseJsonLike

src/lib/prettierFormatter.js:274–284  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

272}
273
274function parseJsonLike(text) {
275 const trimmed = text?.trim();
276 if (!trimmed) return null;
277 const parsed = helpers.parseJSON(trimmed);
278 if (parsed) return parsed;
279 try {
280 return parseSafeExpression(trimmed);
281 } catch (_) {
282 return null;
283 }
284}
285
286function parseJsConfig(directory, source, absolutePath) {
287 if (!source) return null;

Callers 1

loadConfigFileFunction · 0.85

Calls 1

parseSafeExpressionFunction · 0.85

Tested by

no test coverage detected