MCPcopy
hub / github.com/21st-dev/1code / get

Method get

src/main/lib/git/cache/git-cache.ts:33–46  ·  view source on GitHub ↗

* Get an entry from the cache if it exists and is not expired.

(key: string)

Source from the content-addressed store, hash-verified

31 * Get an entry from the cache if it exists and is not expired.
32 */
33 get(key: string): T | null {
34 const entry = this.cache.get(key);
35 if (!entry) return null;
36
37 // Check TTL
38 if (Date.now() - entry.timestamp > this.config.maxAge) {
39 this.delete(key);
40 return null;
41 }
42
43 // Update access count for LRU
44 entry.accessCount++;
45 return entry.data;
46 }
47
48 /**
49 * Get entry only if hash matches (for conditional updates).

Callers 15

handleDeepLinkFunction · 0.45
index.tsFile · 0.45
startCallbackServerMethod · 0.45
handleMcpOAuthCallbackFunction · 0.45
loadMethod · 0.45
loadMcpCredentialMethod · 0.45
withGitLockFunction · 0.45
getIfHashMatchesMethod · 0.45
deleteMethod · 0.45
getStatusMethod · 0.45
getFileContentMethod · 0.45

Calls 1

deleteMethod · 0.95

Tested by

no test coverage detected