diff --git a/src/collections/Node.js b/src/collections/Node.js index a1a909dd..ede29edf 100644 --- a/src/collections/Node.js +++ b/src/collections/Node.js @@ -45,6 +45,9 @@ const traversalMethods = { const self = this; visitor[visitorMethodName] = function(path) { if (self.__paths[i] === path) { + if (type.check(path.value) && (!filter || matchNode(path.value, filter))) { + paths.push(path); + } this.traverse(path); } else { return visit.call(this, path);