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

Function persisted

packages/platform-node-shared/src/internal/multipart.ts:35–43  ·  view source on GitHub ↗
(
  source: Readable,
  headers: IncomingHttpHeaders
)

Source from the content-addressed store, hash-verified

33
34/** @internal */
35export const persisted = (
36 source: Readable,
37 headers: IncomingHttpHeaders
38) =>
39 Multipart.toPersisted(stream(source, headers), (path, file) =>
40 Effect.tryPromise({
41 try: (signal) => NodeStreamP.pipeline((file as FileImpl).file, NFS.createWriteStream(path), { signal }),
42 catch: (cause) => new Multipart.MultipartError({ reason: "InternalError", cause })
43 }))
44
45const convertPart = (part: MP.Part): Multipart.Part =>
46 part._tag === "Field" ? new FieldImpl(part.info, part.value) : new FileImpl(part)

Callers

nothing calls this directly

Calls 1

streamFunction · 0.70

Tested by

no test coverage detected