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

Function parseJSON

src/utils/helpers.js:208–215  ·  view source on GitHub ↗

* Parses JSON string, if fails returns null * @param {Object|Array} string

(string)

Source from the content-addressed store, hash-verified

206 * @param {Object|Array} string
207 */
208 parseJSON(string) {
209 if (!string) return null;
210 try {
211 return JSON.parse(string);
212 } catch (e) {
213 return null;
214 }
215 },
216 /**
217 * Checks whether given type is directory or not
218 * @param {'dir'|'directory'|'folder'} type

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected