MCPcopy
hub / github.com/Effect-TS/effect / layer

Function layer

packages/cli/src/internal/configFile.ts:61–74  ·  view source on GitHub ↗
(fileName: string, options?: {
  readonly formats?: ReadonlyArray<ConfigFile.Kind>
  readonly searchPaths?: ReadonlyArray<string>
})

Source from the content-addressed store, hash-verified

59
60/** @internal */
61export const layer = (fileName: string, options?: {
62 readonly formats?: ReadonlyArray<ConfigFile.Kind>
63 readonly searchPaths?: ReadonlyArray<string>
64}): Layer.Layer<never, ConfigFile.ConfigFileError, Path.Path | FileSystem.FileSystem> =>
65 pipe(
66 makeProvider(fileName, options),
67 Effect.map((provider) =>
68 Layer.fiberRefLocallyScopedWith(DefaultServices.currentServices, (services) => {
69 const current = Context.get(services, ConfigProvider.ConfigProvider)
70 return Context.add(services, ConfigProvider.ConfigProvider, ConfigProvider.orElse(current, () => provider))
71 })
72 ),
73 Layer.unwrapEffect
74 )
75
76/** @internal */
77export const ConfigErrorTypeId: ConfigFile.ConfigErrorTypeId = Symbol.for(

Callers

nothing calls this directly

Calls 5

makeProviderFunction · 0.85
pipeFunction · 0.70
mapMethod · 0.65
getMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…