(self: Context<Services>, key: string)
| 592 | |
| 593 | // Read fields rather than dispatching through a method for contexts from other copies of effect. |
| 594 | const lookup = <Services>(self: Context<Services>, key: string): unknown => { |
| 595 | const impl = self as ContextImpl<Services> |
| 596 | if (impl.overlay !== undefined) return overlayLookup(impl, key) |
| 597 | const value = impl.base.get(key) |
| 598 | return value === undefined && !impl.base.has(key) ? notFound : value |
| 599 | } |
| 600 | |
| 601 | const overlayLookup = (self: ContextImpl<any>, key: string): unknown => { |
| 602 | for (let overlay = self.overlay; overlay; overlay = overlay.parent) { |
no test coverage detected