@extra-map/has-entry.min

Checks if map has an entry. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Usage no npm install needed!

<script type="module">
  import extraMapHasEntryMin from 'https://cdn.skypack.dev/@extra-map/has-entry.min';
</script>

README

Checks if map has an entry. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: has, hasValue, hasEntry, hasSubset, hasPath.
Similar: entry, entries, hasEntry.

This is part of package extra-map.

This is browserified, minified version of @extra-map/has-entry.
It is exported as global variable map_hasEntry.
CDN: unpkg, jsDelivr.


map.hasEntry(x, e, [fc], [fm]);
// x:  a map
// e:  entry?
// fc: compare function (a, b)
// fm: map function (v, k, x)
const map = require("extra-map");

var x = new Map([["a", 1], ["b", 2], ["c", -3]]);
map.hasEntry(x, ["c", 3]);
// false

map.hasEntry(x, ["c", 3], (a, b) => Math.abs(a) - Math.abs(b));
// true

map.hasEntry(x, ["c", 3], null, v => Math.abs(v));
// true


References