hasPath - nodef/extra-entries GitHub Wiki

Check if nested entries has a path.

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

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

var x = ["a", 2], ["b", 4], ["c", 6](/nodef/extra-entries/wiki/"a",-2],-["b",-4],-["c",-6);
var y = ["x", x], ["e", 10], ["f", 12](/nodef/extra-entries/wiki/"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