Skip to content

hasPath

Subhajit Sahu edited this page Jun 28, 2020 · 7 revisions

Checks if nested iterable has a path. 🏃 📼 📦 🌔 📒

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

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

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

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

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

references

Clone this wiki locally