MCPcopy Create free account
hub / github.com/Noumena-Network/code / makeAxiosResponse

Function makeAxiosResponse

src/tools/WebFetchTool/utils.test.ts:27–40  ·  view source on GitHub ↗
(
  url: string,
  body: string,
  contentType = 'text/plain',
)

Source from the content-addressed store, hash-verified

25}
26
27function makeAxiosResponse(
28 url: string,
29 body: string,
30 contentType = 'text/plain',
31): AxiosResponse<ArrayBuffer> {
32 return {
33 config: {},
34 data: arrayBufferFromText(body),
35 headers: { 'content-type': contentType },
36 status: 200,
37 statusText: 'OK',
38 request: { url },
39 } as AxiosResponse<ArrayBuffer>
40}
41
42function makeRedirectError(status: number, location: string): Error {
43 return {

Callers 1

utils.test.tsFile · 0.85

Calls 1

arrayBufferFromTextFunction · 0.85

Tested by

no test coverage detected