Skip to content

Instantly share code, notes, and snippets.

@liddiard
Created February 19, 2015 00:50
Show Gist options
  • Save liddiard/05dd0bc0e44c9e87289c to your computer and use it in GitHub Desktop.
Save liddiard/05dd0bc0e44c9e87289c to your computer and use it in GitHub Desktop.
function astContains(ast, nodeType) {
walk(ast, function(node) {
if (node.type === nodeType)
return true;
});
return false;
}
@amoskyler
Copy link

function astContains(ast, nodeType) {
    walk(ast, function(node) {
        if (node.type === nodeType)
            return true;
        return false;
    });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment