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

Method getOption

packages/effect/src/internal/cache.ts:340–352  ·  view source on GitHub ↗
(key: Key)

Source from the content-addressed store, hash-verified

338 }
339
340 getOption(key: Key): Effect.Effect<Option.Option<Value>, Error> {
341 return core.suspend(() =>
342 Option.match(MutableHashMap.get(this.cacheState.map, key), {
343 onNone: () => {
344 const mapKey = makeMapKey(key)
345 this.trackAccess(mapKey)
346 this.trackMiss()
347 return core.succeed(Option.none<Value>())
348 },
349 onSome: (value) => this.resolveMapValue(value)
350 })
351 )
352 }
353
354 getOptionComplete(key: Key): Effect.Effect<Option.Option<Value>> {
355 return core.suspend(() =>

Callers

nothing calls this directly

Calls 5

trackAccessMethod · 0.95
trackMissMethod · 0.95
resolveMapValueMethod · 0.95
makeMapKeyFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected