How to use the traverseFast function from @babel/types
Find comprehensive JavaScript @babel/types.traverseFast code examples handpicked from public code repositorys.
GitHub: varwasabi/metro
32 33 34 35 36 37 38 39 40 41
}; } function validateOutputAst(ast) { const seenNodes = new Set(); t.traverseFast(ast, function enter(node) { if (seenNodes.has(node)) { throw new Error( 'Found a duplicate ' + node.type +
623
1
0
GitHub: betocantu93/glimmer.js
92 93 94 95 96 97 98 99 100 101
const compiled = precompile(templateString, precompileOptions); const ast = parse(`(${compiled})`); let metaSeen = false; t.traverseFast(ast, (node) => { if (t.isObjectProperty(node)) { if (node.key.value === 'meta') { metaSeen = true; node.value.properties.push(t.objectProperty(t.identifier('scope'), scopeNode));
73
0
1
GitHub: john024x/TiendaAvocado
68 69 70 71 72 73 74 75 76 77 78 79
traverse.visitors = visitors; traverse.verify = visitors.verify; traverse.explode = visitors.explode; traverse.cheap = function (node, enter) { return t.traverseFast(node, enter); }; traverse.node = function (node, opts, scope, state, parentPath, skipKeys) { const keys = t.VISITOR_KEYS[node.type];
0
0
0
@babel/types.identifier is the most popular function in @babel/types (20936 examples)