How to use the isExpressionStatement function from babel-types
Find comprehensive JavaScript babel-types.isExpressionStatement code examples handpicked from public code repositorys.
88 89 90 91 92 93 94 95 96 97
`); } path.traverse({ ThisExpression (thisPath) { const parentNode = thisPath.parentPath.parentPath.parent; const isValid = t.isExpressionStatement(parentNode) || t.isVariableDeclaration(parentNode) || t.isBlockStatement(parentNode) || t.isJSXElement(parentNode) || t.isCallExpression(parentNode) ||
64
411
8
179 180 181 182 183 184 185 186 187 188
* - compacts sequential pug_html = pug_html + any (max of 100) * - further compacts sequential pug_html = pug_html + stringLiteral */ ast_postprocess: function(ast) { let needCompaction = function(c) { return t.isExpressionStatement(c) && t.isAssignmentExpression(c.expression) && c.expression.left.name === 'pug_html' && t.isBinaryExpression(c.expression.right) && c.expression.right.left.name === 'pug_html'
5
43
10
+ 22 other calls in file
183 184 185 186 187 188 189 190 191 192
).declarations[0].id.name = this._componentName; // Change displayName let displayNameExpression = ast.program.body.find( stmt => types.isExpressionStatement(stmt) && types.isAssignmentExpression(stmt.expression) && types.isMemberExpression(stmt.expression.left) && stmt.expression.left.object.name === 'newComponent' ).expression;
0
2
0
+ 3 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)