MCPcopy
hub / github.com/RubyLouvre/anu / useTemplate

Function useTemplate

test/babel.js:1313–1327  ·  view source on GitHub ↗
(ast, nodes)

Source from the content-addressed store, hash-verified

1311 var TEMPLATE_SKIP = (0, _symbol2.default)();
1312
1313 function useTemplate(ast, nodes) {
1314 ast = (0, _cloneDeep2.default)(ast);
1315 var _ast = ast,
1316 program = _ast.program;
1317
1318 if (nodes.length) {
1319 (0, _babelTraverse2.default)(ast, templateVisitor, null, nodes);
1320 }
1321
1322 if (program.body.length > 1) {
1323 return program.body;
1324 } else {
1325 return program.body[0];
1326 }
1327 }
1328
1329 var templateVisitor = {
1330 noScope: true,

Callers 1

babel.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected