@extra-entries/has-entry

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

Usage no npm install needed!

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

README

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

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

This is part of package extra-entries.


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

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

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

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


References