code: function(ast, filter) {
    checkASTandFunction(ast, 'ast', filter, 'filter');
  
    let result = [];
    walkNodes(ast, node => {
      if (filter(node)) result.push(Object.assign({}, node));
    });
    return result;
  }
docs: /*
  Change findNodes ==> filterNodes
   
  @name filterNodes
  @type {function}
  @description
  Function to find certain nodes based on a filter passed.
  @param {object} ast   AST node
  @param {function} filter  Filter function to find nodes
  @return {object[]} Array of all the nodes found