Skip to content

hasPath

Subhajit Sahu edited this page Jun 28, 2020 · 7 revisions

Checks if nested entries has a path. 🏃 📼 📦 🌔 📒

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

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

var x = [['a', 2], ['b', 4], ['c', 6]];
var y = [['x', x], ['e', 10], ['f', 12]];
entries.hasPath(y, ['e']);
// true

entries.hasPath(y, ['x', 'b']);
// true

entries.hasPath(y, ['x', 'b', 'c']);
// false

references

Clone this wiki locally