MCPcopy Index your code
hub / github.com/Effect-TS/effect / decodeString

Function decodeString

packages/platform/src/Ndjson.ts:198–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196}
197
198const decodeString = <IE, Done>() => {
199 const decoder = new TextDecoder()
200 const loop: Channel.Channel<
201 Chunk.Chunk<string>,
202 Chunk.Chunk<Uint8Array>,
203 IE,
204 IE,
205 Done,
206 Done,
207 never
208 > = Channel.readWithCause({
209 onInput: (input) =>
210 Channel.zipRight(
211 Channel.write(Chunk.map(input, (_) => decoder.decode(_))),
212 loop
213 ),
214 onFailure: Channel.failCause,
215 onDone: Channel.succeed
216 })
217 return loop
218}
219
220/**
221 * @since 1.0.0

Callers 1

unpackFunction · 0.85

Calls 3

decodeMethod · 0.80
writeMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected