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

Method get

cache/ttl_cache.ts:221–225  ·  view source on GitHub ↗

* Gets the value associated with the specified key. * * @experimental **UNSTABLE**: New API, yet to be vetted. * * When code TtlCacheOptions.slidingExpiration | slidingExpiration is * enabled, accessing an entry resets its TTL. * * @param key The key to get the value for.

(key: K)

Source from the content-addressed store, hash-verified

219 * ```
220 */
221 override get(key: K): V | undefined {
222 if (!super.has(key)) return undefined;
223 if (this.#slidingExpiration) this.#resetTtl(key);
224 return super.get(key);
225 }
226
227 /**
228 * Returns the value associated with the given key, or `undefined` if the

Callers

nothing calls this directly

Calls 3

#resetTtlMethod · 0.95
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected