MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeFlat

Function makeFlat

packages/effect/src/internal/configProvider.ts:66–83  ·  view source on GitHub ↗
(
  options: {
    readonly load: <A>(
      path: ReadonlyArray<string>,
      config: Config.Config.Primitive<A>,
      split: boolean
    ) => Effect.Effect<Array<A>, ConfigError.ConfigError>
    readonly enumerateChildren: (
      path: ReadonlyArray<string>
    ) => Effect.Effect<HashSet.HashSet<string>, ConfigError.ConfigError>
    readonly patch: PathPatch.PathPatch
  }
)

Source from the content-addressed store, hash-verified

64
65/** @internal */
66export const makeFlat = (
67 options: {
68 readonly load: <A>(
69 path: ReadonlyArray<string>,
70 config: Config.Config.Primitive<A>,
71 split: boolean
72 ) => Effect.Effect<Array<A>, ConfigError.ConfigError>
73 readonly enumerateChildren: (
74 path: ReadonlyArray<string>
75 ) => Effect.Effect<HashSet.HashSet<string>, ConfigError.ConfigError>
76 readonly patch: PathPatch.PathPatch
77 }
78): ConfigProvider.ConfigProvider.Flat => ({
79 [FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
80 patch: options.patch,
81 load: (path, config, split = true) => options.load(path, config, split),
82 enumerateChildren: options.enumerateChildren
83})
84
85/** @internal */
86export const fromFlat = (flat: ConfigProvider.ConfigProvider.Flat): ConfigProvider.ConfigProvider =>

Callers 5

fromEnvFunction · 0.85
fromMapFunction · 0.85
mapInputPathFlatFunction · 0.85
configProvider.tsFile · 0.85
orElseFlatFunction · 0.85

Calls 1

loadMethod · 0.65

Tested by

no test coverage detected