MCPcopy Create free account
hub / github.com/Effect-TS/effect / runParser

Function runParser

packages/effect/benchmark/http/multipart.ts:48–64  ·  view source on GitHub ↗
(chunks: Array<Uint8Array>)

Source from the content-addressed store, hash-verified

46const fields100 = fieldsPayload(100)
47
48const runParser = (chunks: Array<Uint8Array>) => {
49 const parser = MultipartParser.make({
50 headers,
51 onField() {},
52 onFile() {
53 return () => {}
54 },
55 onError(error) {
56 throw new Error(`unexpected error: ${error._tag}`)
57 },
58 onDone() {}
59 })
60 for (let i = 0; i < chunks.length; i++) {
61 parser.write(chunks[i])
62 }
63 parser.end()
64}
65
66const runChannelDrain = (chunks: Array<Uint8Array>) =>
67 Effect.runPromise(

Callers 1

multipart.tsFile · 0.85

Calls 3

makeMethod · 0.65
writeMethod · 0.65
endMethod · 0.65

Tested by

no test coverage detected