( configKey: string, fromCLI: Option.Option<string | Record<string, unknown>>, fromDocgenJson: Option.Option<string | Record<string, unknown>> )
| 230 | ) |
| 231 | |
| 232 | const resolveCompilerOptions = ( |
| 233 | configKey: string, |
| 234 | fromCLI: Option.Option<string | Record<string, unknown>>, |
| 235 | fromDocgenJson: Option.Option<string | Record<string, unknown>> |
| 236 | ): Effect.Effect<{ readonly [x: string]: unknown }, never, Path.Path | Domain.Process> => { |
| 237 | const fromConfigProvider = loadCompilerOptions(configKey) |
| 238 | return Effect.gen(function*() { |
| 239 | let config: string | Record<string, unknown> |
| 240 | if (Option.isSome(fromCLI)) { |
| 241 | config = fromCLI.value |
| 242 | } else { |
| 243 | const provided = yield* Effect.result(fromConfigProvider) |
| 244 | if (Result.isSuccess(provided)) { |
| 245 | config = provided.success |
| 246 | } else if (Option.isSome(fromDocgenJson)) { |
| 247 | config = fromDocgenJson.value |
| 248 | } else { |
| 249 | config = defaultCompilerOptions |
| 250 | } |
| 251 | } |
| 252 | return typeof config === "string" ? yield* readTSConfig(config) : config |
| 253 | }) |
| 254 | } |
| 255 | |
| 256 | const JsonRecordSchema = Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown)) |
| 257 |
no test coverage detected