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

Function arrayBuffer

packages/platform/node/src/NodeHttpIncomingMessage.ts:125–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123
124 private arrayBufferEffect: Effect.Effect<ArrayBuffer, E> | undefined
125 get arrayBuffer(): Effect.Effect<ArrayBuffer, E> {
126 if (this.arrayBufferEffect) {
127 return this.arrayBufferEffect
128 }
129 this.arrayBufferEffect = Effect.withFiber((fiber) =>
130 NodeStream.toArrayBuffer(() => this.source, {
131 onError: this.onError,
132 maxBytes: fiber.getRef(IncomingMessage.MaxBodySize)
133 })
134 ).pipe(
135 Effect.cached,
136 Effect.runSync
137 )
138 this.textEffect = Effect.map(this.arrayBufferEffect, (_) => new TextDecoder().decode(_))
139 return this.arrayBufferEffect
140 }
141}

Callers

nothing calls this directly

Calls 3

getRefMethod · 0.80
pipeMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected