MCPcopy
hub / github.com/simstudioai/sim / makeRequest

Function makeRequest

apps/sim/app/api/table/import-csv/route.test.ts:74–93  ·  view source on GitHub ↗
(parts: Part[], chunkSize?: number)

Source from the content-addressed store, hash-verified

72}
73
74function makeRequest(parts: Part[], chunkSize?: number): NextRequest {
75 const body = buildBody(parts)
76 const stream = new ReadableStream<Uint8Array>({
77 start(controller) {
78 if (chunkSize) {
79 for (let i = 0; i < body.length; i += chunkSize) {
80 controller.enqueue(new Uint8Array(body.subarray(i, i + chunkSize)))
81 }
82 } else {
83 controller.enqueue(new Uint8Array(body))
84 }
85 controller.close()
86 },
87 })
88 return {
89 headers: new Headers({ 'content-type': `multipart/form-data; boundary=${BOUNDARY}` }),
90 body: stream,
91 signal: undefined,
92 } as unknown as NextRequest
93}
94
95function csvWithRows(count: number): string {
96 const lines = ['name,age']

Callers 1

route.test.tsFile · 0.70

Calls 1

buildBodyFunction · 0.70

Tested by

no test coverage detected