MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / get

Method get

src/shared/utils/cache.ts:5–14  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

3 private data = new Map<string, CacheItem<T>>();
4
5 public get(key: string): T | undefined {
6 const item = this.data.get(key);
7
8 if (item && item.expiryTime < new Date().getTime()) {
9 this.data.delete(key);
10 return undefined;
11 }
12
13 return item?.data;
14 }
15
16 public add(key: string, item: T, millisecondsToCache: number) {
17 this.data.set(

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.80

Tested by

no test coverage detected