2.2.18 • Published 4 years ago
@extra-entries/has-path v2.2.18
Checks if nested entries has a path. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
Alternatives: has, hasValue, hasEntry, hasSubset, hasPath. Similar: hasPath, getPath.
This is part of package extra-entries.
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