-
Notifications
You must be signed in to change notification settings - Fork 0
hasPath
Subhajit Sahu edited this page Dec 22, 2022
·
7 revisions
Check if nested ientries has a path.
Alternatives: has, hasValue, hasEntry, hasSubset, hasPath.
Similar: hasPath, getPath.
function hasPath(x, p)
// x: nested ientries
// p: search path
const ientries = require('extra-ientries');
var x = [["a", 2], ["b", 4], ["c", 6]];
var y = [["x", x], ["e", 10], ["f", 12]];
ientries.hasPath(y, ["e"]);
// → true
ientries.hasPath(y, ["x", "b"]);
// → true
ientries.hasPath(y, ["x", "b", "c"]);
// → false