2.2.18 • Published 4 years ago

@extra-entries/has-value v2.2.18

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

Checks if map has a value. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: has, hasValue, hasEntry, hasSubset, hasPath. Similar: value, values, hasValue.

This is part of package extra-entries.

entries.hasValue(x, v, [fc], [fm]);
// x:  a map
// v:  value?
// 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.hasValue(x, 3);
// false

entries.hasValue(x, 3, (a, b) => Math.abs(a) - Math.abs(b));
// true

entries.hasValue(x, 3, null, v => Math.abs(v));
// true

References

2.2.18

4 years ago

2.2.17

4 years ago

2.2.15

4 years ago

2.2.16

4 years ago

2.2.14

4 years ago

2.2.12

5 years ago

2.2.11

5 years ago

2.2.9

5 years ago

2.2.10

5 years ago

2.2.7

5 years ago

2.2.8

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago