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

Method text

packages/platform/node/src/NodeHttpClient.ts:274–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272
273 private textBody?: Effect.Effect<string, Error.HttpClientError>
274 get text(): Effect.Effect<string, Error.HttpClientError> {
275 if (this.textBody) {
276 return this.textBody
277 }
278 this.textBody = Effect.tryPromise({
279 try: () => this.source.body.text(),
280 catch: (cause) =>
281 new Error.HttpClientError({
282 reason: new Error.DecodeError({
283 request: this.request,
284 response: this,
285 cause
286 })
287 })
288 }).pipe(Effect.cached, Effect.runSync)
289 this.arrayBufferBody = Effect.map(this.textBody, (_) => new TextEncoder().encode(_).buffer)
290 return this.textBody
291 }
292
293 get urlParamsBody(): Effect.Effect<UrlParams.UrlParams, Error.HttpClientError> {
294 return Effect.flatMap(this.text, (_) =>

Callers 8

makeHandlerFunction · 0.45
makeFailingAppFunction · 0.45
makeLayerHandlerFunction · 0.45
HttpApi.test.tsFile · 0.45

Calls 2

pipeMethod · 0.65
mapMethod · 0.45

Tested by 3

makeHandlerFunction · 0.36
makeFailingAppFunction · 0.36
makeLayerHandlerFunction · 0.36