( path: string, config?: Partial<ConfigProvider.ConfigProvider.FromMapConfig> )
| 17 | |
| 18 | /** @internal */ |
| 19 | export const fromDotEnv = ( |
| 20 | path: string, |
| 21 | config?: Partial<ConfigProvider.ConfigProvider.FromMapConfig> |
| 22 | ): Effect.Effect<ConfigProvider.ConfigProvider, PlatformError, FileSystem.FileSystem> => |
| 23 | Effect.gen(function*() { |
| 24 | const fs = yield* FileSystem.FileSystem |
| 25 | const content = yield* fs.readFileString(path) |
| 26 | const obj = parseDotEnv(content) |
| 27 | return ConfigProvider.fromMap( |
| 28 | new Map(Object.entries(obj)), |
| 29 | Object.assign({}, { pathDelim: "_", seqDelim: "," }, config) |
| 30 | ) |
| 31 | }) |
| 32 | |
| 33 | /** @internal */ |
| 34 | export const layerDotEnv = (path: string): Layer.Layer<never, PlatformError, FileSystem.FileSystem> => |
no test coverage detected