From 15437361e1440784008a2062a8e8b1130d9b26db Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Mon, 24 Oct 2016 17:21:46 -0700 Subject: [PATCH] Add iterator in PathSet for superset and subset combination --- lib/path-set.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/path-set.js b/lib/path-set.js index eb0cda5..4a9c964 100644 --- a/lib/path-set.js +++ b/lib/path-set.js @@ -111,6 +111,15 @@ class PathSet { } + *all(path, depth) { + var p = path.slice(); + for (let i = 0; i < p.length; ++ i) + if (p[i] === '*') + p[i] = null; + yield* this.find(p, depth || 0, true); + } + + *find(pattern, depth, wildcard) { var sets = [];