MCPcopy Create free account
hub / github.com/denoland/std / get

Method get

cache/lru_cache.ts:207–215  ·  view source on GitHub ↗

* Gets the element with the specified key. * * @param key The key to get the value for. * @returns The value associated with the specified key, or `undefined` if * the key is not present in the cache. * * @example Getting a value from the cache * ```ts * import { LruCache } f

(key: K)

Source from the content-addressed store, hash-verified

205 * ```
206 */
207 override get(key: K): V | undefined {
208 if (super.has(key)) {
209 const value = super.get(key)!;
210 this.#setMostRecentlyUsed(key, value);
211 return value;
212 }
213
214 return undefined;
215 }
216
217 /**
218 * Returns the value associated with the given key, or `undefined` if the

Callers

nothing calls this directly

Calls 3

#setMostRecentlyUsedMethod · 0.95
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected