UNPKG

@extra-array/has-path

Version:

Checks if nested array has a path.

13 lines (12 loc) 216 B
function is(v) { return Array.isArray(v); } function hasPath(x, p) { for (var i of p) { if (!is(x)) return false; x = x[i]; } return true; } export { hasPath as default };