( path: string )
| 186 | |
| 187 | // TODO: this is invoked twice |
| 188 | const readDocgenConfig = ( |
| 189 | path: string |
| 190 | ): Effect.Effect<Option.Option<Schema.Schema.Type<typeof ConfigurationSchema>>, never, FileSystem.FileSystem> => { |
| 191 | return Effect.gen(function*() { |
| 192 | const fs = yield* FileSystem.FileSystem |
| 193 | const exists = yield* Effect.orDie(fs.exists(path)) |
| 194 | if (exists) { |
| 195 | const config = yield* validateJsonFile(ConfigurationSchema, path) |
| 196 | return Option.some(config) |
| 197 | } else { |
| 198 | return Option.none() |
| 199 | } |
| 200 | }) |
| 201 | } |
| 202 | |
| 203 | const readTSConfig = (fileName: string): Effect.Effect< |
| 204 | { readonly [x: string]: unknown }, |
no test coverage detected