MCPcopy Create free account
hub / github.com/vercel/vercel / get

Method get

packages/functions/src/cache/in-memory-cache.ts:13–24  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

11 private cache: Record<string, CacheEntry> = {};
12
13 async get(key: string): Promise<unknown | null> {
14 const entry = this.cache[key];
15 if (entry) {
16 if (entry.ttl && entry.lastModified + entry.ttl * 1000 < Date.now()) {
17 // If the entry is expired, delete it and return null
18 await this.delete(key);
19 return null;
20 }
21 return JSON.parse(entry.value);
22 }
23 return null;
24 }
25
26 async set(
27 key: string,

Callers

nothing calls this directly

Calls 2

deleteMethod · 0.95
parseMethod · 0.45

Tested by

no test coverage detected