2.2.5 • Published 3 years ago

@extra-object/has-value.min v2.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Checks if object has a value. :running: :package: :ledger:

Alternatives: has, hasValue, hasEntry, hasSubset, hasPath. Similar: value, values, hasValue. This is part of package extra-object.

This is browserified, minified version of @extra-object/has-value. It is exported as global variable object_hasValue. CDN: unpkg, jsDelivr.

object.hasValue(x, v, [fc], [fm]);
// x:  an object
// v:  value?
// fc: compare function (a, b)
// fm: map function (v, k, x)
const object = require('extra-object');

var x = {a: 1, b: 2, c: -3};
object.hasValue(x, 3);
// false

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

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

references

2.2.5

3 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago