(key: string)
| 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)), |
no test coverage detected