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

Function layer

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

Source from the content-addressed store, hash-verified

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