MCPcopy
hub / github.com/ThatGuySam/doesitarm / parseResponseBody

Function parseResponseBody

helpers/http.js:69–85  ·  view source on GitHub ↗
( response, responseType )

Source from the content-addressed store, hash-verified

67}
68
69async function parseResponseBody ( response, responseType ) {
70 if ( responseType === 'none' ) {
71 return null
72 }
73
74 if ( responseType === 'text' ) {
75 return await response.text()
76 }
77
78 const text = await response.text()
79
80 if ( text.length === 0 ) {
81 return null
82 }
83
84 return JSON.parse( text )
85}
86
87function buildRequestInit ( {
88 body,

Callers 1

requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected