MCPcopy Create free account
hub / github.com/arctic-cli/interface / readResponseBody

Function readResponseBody

packages/arctic/src/provider/usage.ts:969–980  ·  view source on GitHub ↗
(response: any)

Source from the content-addressed store, hash-verified

967 }
968
969 const readResponseBody = async (response: any): Promise<string> => {
970 if (response && typeof response.text === "function") {
971 return await response.text().catch(() => "[read text failed]")
972 }
973 if (response && typeof response.json === "function") {
974 return await response
975 .json()
976 .then((data: unknown) => JSON.stringify(data))
977 .catch(() => "[read json failed]")
978 }
979 return "[no body reader]"
980 }
981
982 const responseMeta = (response: any) => {
983 const headers =

Callers 2

loadManagedProjectFunction · 0.85
onboardManagedProjectFunction · 0.85

Calls 2

textMethod · 0.65
jsonMethod · 0.65

Tested by

no test coverage detected