Function
file
(
path: string,
options?: FileSystem.StreamOptions & { readonly contentType?: string }
)
Source from the content-addressed store, hash-verified
| 140 | |
| 141 | /** @internal */ |
| 142 | export const file = ( |
| 143 | path: string, |
| 144 | options?: FileSystem.StreamOptions & { readonly contentType?: string } |
| 145 | ): Effect.Effect<Body.Stream, PlatformError.PlatformError, FileSystem.FileSystem> => |
| 146 | Effect.flatMap( |
| 147 | FileSystem.FileSystem, |
| 148 | (fs) => |
| 149 | Effect.map(fs.stat(path), (info) => |
| 150 | stream( |
| 151 | fs.stream(path, options), |
| 152 | options?.contentType, |
| 153 | Number(info.size) |
| 154 | )) |
| 155 | ) |
| 156 | |
| 157 | /** @internal */ |
| 158 | export const fileInfo = ( |
Callers
nothing calls this directly
Tested by
no test coverage detected