-
Notifications
You must be signed in to change notification settings - Fork 0
hasPath
Subhajit Sahu edited this page Feb 4, 2021
·
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