2.2.10 • Published 4 years ago
@extra-lists/has-path v2.2.10
Checks if nested lists 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-lists.
lists.hasPath(x, p);
// x: nested lists
// p: path
const lists = require('extra-lists');
var x = [['a', 'b', 'c'], [2, 4, 6]];
var y = [['x', 'e', 'f'], [x, 10, 12]];
lists.hasPath(y, ['e']);
// true
lists.hasPath(y, ['x', 'b']);
// true
lists.hasPath(y, ['x', 'b', 'c']);
// false