MCPcopy Index your code
hub / github.com/zxlie/FeHelper / _parseJsonLike

Function _parseJsonLike

apps/json-format/content-script.js:102–121  ·  view source on GitHub ↗
(source, parseOptions)

Source from the content-addressed store, hash-verified

100 }, overrides || {});
101
102 let _parseJsonLike = (source, parseOptions) => {
103 const utils = _getJsonAutoUtils();
104 if (typeof utils.parseJSONLike === 'function') {
105 return utils.parseJSONLike(source, _getJsonParseOptions(parseOptions));
106 }
107
108 try {
109 const value = JSON.parse(String(source || '').trim());
110 if (value && typeof value === 'object') {
111 return {
112 value,
113 normalizedSource: JSON.stringify(value),
114 funcName: null,
115 fnTry: null,
116 fnCatch: null
117 };
118 }
119 } catch (e) {}
120 return null;
121 };
122
123 let _stringifyJsonForFormatter = jsonObj => {
124 const utils = _getJsonAutoUtils();

Callers 4

_coerceDecodedJsonSourceFunction · 0.85
_didFormatFunction · 0.85
_getJsonContentFromDOMFunction · 0.85
_getJsonObjectFunction · 0.85

Calls 3

_getJsonAutoUtilsFunction · 0.85
_getJsonParseOptionsFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected