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

Function unsafeGet

packages/experimental/src/Persistence.ts:342–351  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

340 Effect.map(Effect.clock, (clock) => {
341 const map = getStore(storeId)
342 const unsafeGet = (key: string): Option.Option<unknown> => {
343 const value = map.get(key)
344 if (value === undefined) {
345 return Option.none()
346 } else if (value[1] !== null && value[1] <= clock.unsafeCurrentTimeMillis()) {
347 map.delete(key)
348 return Option.none()
349 }
350 return Option.some(value[0])
351 }
352 return identity<BackingPersistenceStore>({
353 get: (key) => Effect.sync(() => unsafeGet(key)),
354 getMany: (keys) => Effect.sync(() => keys.map(unsafeGet)),

Callers 1

Persistence.tsFile · 0.70

Calls 2

getMethod · 0.65

Tested by

no test coverage detected