MCPcopy Create free account
hub / github.com/ambianic/peerfetch / jsonify

Method jsonify

javascript/src/peerfetch.ts:594–606  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

592 }
593
594 jsonify (data: any) {
595 let decodedString
596 console.debug('jsonify', data)
597 if (!data) {
598 decodedString = '{}'
599 } else if (typeof data === 'string') {
600 decodedString = data
601 } else {
602 decodedString = this.textDecode(data)
603 }
604 const response = JSON.parse(decodedString)
605 return response
606 }
607
608 _checkResponseReady (ticket: number) {
609 let request = null

Callers 1

Calls 1

textDecodeMethod · 0.95

Tested by

no test coverage detected