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

Function flatten

packages/effect/src/Context.ts:514–520  ·  view source on GitHub ↗
(self: ContextImpl<any>)

Source from the content-addressed store, hash-verified

512}
513
514const flatten = (self: ContextImpl<any>): ReadonlyMap<string, any> => {
515 if (self._flat) return self._flat
516 if (!self.overlay) return self._flat = self.base
517 const map = new Map(self.base)
518 applyOverlays(map, self.overlay)
519 return self._flat = map
520}
521
522const withFlat = <B>(self: Context<any>, f: (map: Map<string, any>) => void): Context<B> => {
523 const map = new Map(self.mapUnsafe)

Callers 2

lookupFunction · 0.70
mapUnsafeFunction · 0.70

Calls 1

applyOverlaysFunction · 0.85

Tested by

no test coverage detected