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

Function getReferenceUnsafe

packages/effect/src/Context.ts:1183–1186  ·  view source on GitHub ↗
(self: Context<Services>, ref: Reference<Shape>)

Source from the content-addressed store, hash-verified

1181 * @internal
1182 */
1183export const getReferenceUnsafe = <Services, Shape>(self: Context<Services>, ref: Reference<Shape>): Shape => {
1184 const value = lookup(self, ref.key)
1185 return value === notFound ? getDefaultValue(ref) : value as Shape
1186}
1187
1188const ServiceNotFoundErrorTypeId = "~effect/Context/ServiceNotFoundError" as const
1189

Callers

nothing calls this directly

Calls 2

getDefaultValueFunction · 0.85
lookupFunction · 0.70

Tested by

no test coverage detected