MCPcopy Create free account
hub / github.com/Effect-TS/effect / readDocgenConfig

Function readDocgenConfig

packages/tools/docgen/src/Configuration.ts:188–201  ·  view source on GitHub ↗
(
  path: string
)

Source from the content-addressed store, hash-verified

186
187// TODO: this is invoked twice
188const 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
203const readTSConfig = (fileName: string): Effect.Effect<
204 { readonly [x: string]: unknown },

Callers 2

loadFunction · 0.85
Configuration.tsFile · 0.85

Calls 2

validateJsonFileFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected