( source: Readable, headers: IncomingHttpHeaders )
| 60 | * @since 4.0.0 |
| 61 | */ |
| 62 | export const persisted = ( |
| 63 | source: Readable, |
| 64 | headers: IncomingHttpHeaders |
| 65 | ): Effect.Effect< |
| 66 | Multipart.Persisted, |
| 67 | Multipart.MultipartError, |
| 68 | Scope.Scope | FileSystem.FileSystem | Path.Path |
| 69 | > => |
| 70 | Multipart.toPersisted(stream(source, headers), (path, file) => |
| 71 | Effect.tryPromise({ |
| 72 | try: (signal) => NodeStreamP.pipeline((file as FileImpl).file, NFS.createWriteStream(path), { signal }), |
| 73 | catch: (cause) => Multipart.MultipartError.fromReason("InternalError", cause) |
| 74 | })) |
| 75 | |
| 76 | /** |
| 77 | * Returns the underlying Node readable stream for a multipart file produced by |
nothing calls this directly
no test coverage detected