2.2.5 • Published 3 years ago

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

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

Checks if nested object has a path. :running: :package: :ledger:

Alternatives: has, hasValue, hasEntry, hasSubset, hasPath. Similar: hasPath, getPath, setPath$, removePath$. This is part of package extra-object.

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

object.hasPath(x, p);
// x: a nested object
// p: path
const object = require('extra-object');

var x = {a: {b: 2, c: 3}, d: 4};
object.hasPath(x, ['d']);
// true

object.hasPath(x, ['a', 'b']);
// true

object.hasPath(x, ['a', 'b', 'c']);
// false

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