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

Function withAbsenceFallback

packages/effect/test/Config.test.ts:410–414  ·  view source on GitHub ↗
(fallback: Config.Config<A>)

Source from the content-addressed store, hash-verified

408 const symbol = Symbol()
409 const withAbsenceFallback =
410 <A, B>(fallback: Config.Config<A>) => (self: Config.Config<B>): Config.Config<A | B> =>
411 Config.flatMap(
412 Config.withDefault(self, symbol),
413 (e) => e === symbol ? fallback : Config.succeed<A | B>(e)
414 )
415
416 const portConfig = Config.Port("BACKEND_PORT").pipe(
417 withAbsenceFallback(Config.Port("POOORT")),

Callers 1

Config.test.tsFile · 0.85

Calls 1

succeedMethod · 0.45

Tested by

no test coverage detected