hasPath - nodef/extra-iterable GitHub Wiki

Check if nested iterable has a path.

Alternatives: hasValue, hasPrefix, hasInfix, hasSuffix, hasSubsequence, hasPath. Similar: hasPath, getPath.

function hasPath(x, p)
// x: a nested iterable
// p: path
const xiterable = require('extra-iterable');

var x = [[2, 4], 6, 8];
xiterable.hasPath(x, [1]);
// → true

xiterable.hasPath(x, [0, 1]);
// → true

xiterable.hasPath(x, [0, 1, 2]);
// → false

References