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

Method hasEntry

data_structures/unstable_multimap.ts:257–262  ·  view source on GitHub ↗

* Returns `true` if the `[key, value]` entry exists in the map (i.e. the * given value appears at least once under the given key). * * @experimental **UNSTABLE**: New API, yet to be vetted. * * @param key The key to look up. * @param value The value to check. * @returns `true` i

(key: K, value: V)

Source from the content-addressed store, hash-verified

255 * ```
256 */
257 hasEntry(key: K, value: V): boolean {
258 // `Array.prototype.includes` uses SameValueZero, which matches the
259 // hand-rolled loop in `deleteEntry()` (and the `Map`/`Set` contract) so
260 // `NaN` and `±0` behave consistently across the two methods.
261 return this.#map.get(key)?.includes(value) ?? false;
262 }
263
264 /**
265 * Removes all values for the given key.

Callers 1

Calls 2

includesMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected