Sha256: 11b1d8a754cbebf334d63e698dce5b98b97c3d18a87fb479452161d24a06ca35
Contents?: true
Size: 412 Bytes
Versions: 11
Compression:
Stored size: 412 Bytes
Contents
var breakable = require("./breakable"); var esprima = require("esprima").parse; var traverse = require("ast-traverse"); var ast = esprima("f(!x, y)"); var val = breakable(function(brk) { traverse(ast, {pre: function(node) { if (node.type === "UnaryExpression" && node.operator === "!") { brk(node.argument); } }}); }); console.dir(val); // { type: 'Identifier', name: 'x' }
Version data entries
11 entries across 11 versions & 4 rubygems