How to use the isMemberExpression function from babel-types
Find comprehensive JavaScript babel-types.isMemberExpression code examples handpicked from public code repositorys.
33 34 35 36 37 38 39 40 41 42
); out_file.write('/*\n *\n * https://www.w3.org/Style/CSS/all-properties.en.html\n */\n\n'); function isModuleDotExports(node) { return ( t.isMemberExpression(node, { computed: false }) && t.isIdentifier(node.object, { name: 'module' }) && t.isIdentifier(node.property, { name: 'exports' }) ); }
+ 77 other calls in file
GitHub: pugjs/then-pug
![pugjs profile picture](/pugjs.png?size=40)
110 111 112 113 114 115 116 117 118 119
Compiler.prototype.ast_postprocess = function(ast) { let needCompaction = function(c) { return t.isExpressionStatement(c) && t.isCallExpression(c.expression) && t.isMemberExpression(c.expression.callee) && t.isIdentifier(c.expression.callee.object) && c.expression.callee.object.name === 'buf' && t.isIdentifier(c.expression.callee.property) && c.expression.callee.property.name === 'push'
+ 7 other calls in file
39 40 41 42 43 44 45 46 47
const parts = Array.isArray(match) ? match : match.split('.'); const nodes = []; let node; for (node = member; babelTypes.isMemberExpression(node); node = node.object) { nodes.push(node.property); } nodes.push(node);
+ 5 other calls in file
GitHub: btd/documentation
![btd profile picture](/btd.png?size=40)
143 144 145 146 147 148 149 150 151 152
* Deal with an oddity of espree: the jsdoc comment is attached to a different * node in the two expressions `a.b = c` vs `a.b = function () {}`. */ if (n.isExpressionStatement(path.node) && n.isAssignmentExpression(path.node.expression) && n.isMemberExpression(path.node.expression.left)) { path = path.get('expression').get('left'); } /*
+ 3 other calls in file
17 18 19 20 21 22 23 24 25 26
function match(path, ctx, explicitOnly) { const node = path.node; const isMethodCall = ( t.isCallExpression(node) && t.isMemberExpression(node.callee) && node.callee.computed === false ); if(isMethodCall && ngInject.inspectComment(path, ctx)){
+ 11 other calls in file
39 40 41 42 43 44 45 46 47 48
(attr, idx) => { if (t.isJSXSpreadAttribute(attr)) { invariant( // only allow member expressions and identifiers to be spread for now t.isIdentifier(attr.argument) || t.isMemberExpression(attr.argument), 'Unhandled spread operator value of type `%s` (`%s`)', attr.argument.type, generate(attr).code );
+ 5 other calls in file
25 26 27 28 29 30 31 32 33 34
out_file.write('\'use strict\';\n\n// autogenerated\n\n'); out_file.write('/*\n *\n * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties\n */\n\n'); function isModuleDotExports(node) { return ( t.isMemberExpression(node, {computed: false}) && t.isIdentifier(node.object, {name: 'module'}) && t.isIdentifier(node.property, {name: 'exports'}) ); }
+ 5 other calls in file
GitHub: MarshallOfSound/parcel
![MarshallOfSound profile picture](/MarshallOfSound.png?size=40)
214 215 216 217 218 219
} // If we can statically evaluate the name of a CommonJS export, create an ES6-style export for it. // This allows us to remove the CommonJS export object completely in many cases. if ( t.isMemberExpression(left) &&
+ 9 other calls in file
GitHub: bluepeople1/mpx
![bluepeople1 profile picture](/bluepeople1.png?size=40)
36 37 38 39 40 41 42 43 44 45
CallExpression: { enter (path) { const callee = path.node.callee const args = path.node.arguments if ( t.isMemberExpression(callee) && t.isThisExpression(callee.object) && (callee.property.name === '__travel' || callee.property.value === '__travel') && t.isBooleanLiteral(args[2]) && args[2].value === true
+ 5 other calls in file
GitHub: captainwz/react-pocket
![captainwz profile picture](/captainwz.png?size=40)
139 140 141 142 143 144 145 146 147 148
}); } } } if (t.isCallExpression(p.node) && t.isMemberExpression(p.node.callee) && p.node.callee.object.name == 'ReactDOM' && p.node.callee.property.name == 'render' && t.isJSXElement(p.node.arguments[0])) { var el = p.node.arguments[0].openingElement; objArr.forEach(function (obj) {
+ 7 other calls in file
GitHub: captainwz/react-pocket
![captainwz profile picture](/captainwz.png?size=40)
163 164 165 166 167 168 169 170 171
} } if (t.isCallExpression(p.node) && t.isMemberExpression(p.node.callee) && p.node.callee.object.name == 'ReactDOM' && p.node.callee.property.name == 'render' && t.isJSXElement(p.node.arguments[0])) {
+ 3 other calls in file
270 271 272 273 274 275 276 277 278 279
} const expr = t.list([t.symbol("set!"), next(ast.left), next(ast.right)]); if ( bt.isMemberExpression(ast.left) && utils.isNestedThisExpression(ast.left) ) { utils.alterNestedThisExpression("that", ast.left); return THIS_AS("that", [expr]);
185 186 187 188 189 190 191 192 193 194
// 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; displayNameExpression.left.object.name = this._componentName;
+ 3 other calls in file
GitHub: t-mart/gvd
66 67 68 69 70 71 72 73 74 75 76
t.isRegExpLiteral(n); function simplifyCharCodeAt(path) { var node = path.node; var charCodeCallExprNode = (t.isCallExpression(node.left) && t.isMemberExpression(node.left.callee) && t.isIdentifier(node.left.callee.property) && node.left.callee.property.name === 'charCodeAt') ? node.left : (t.isCallExpression(node.right)
+ 5 other calls in file
GitHub: schempy/platelunch
238 239 240 241 242 243 244 245 246 247
VariableDeclarator: path => { variables = [...variables, path.node.id.name]; }, AssignmentExpression: path => { if (path.node.operator === "=" && t.isMemberExpression(path.node.left)) { if (t.isThisExpression(path.node.left.object)) { members = [...members, path.node.left.property.name]; } }
GitHub: tadasant/parcel
![tadasant profile picture](/tadasant.png?size=40)
95 96 97 98 99 100 101 102 103 104
// redeclared in this scope if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return; if (path.parentPath.isCallExpression({callee: path.node})) { path.replaceWith(t.sequenceExpression([t.numericLiteral(0), remap])); } else if (path.isJSXIdentifier() && t.isMemberExpression(remap)) { const {object, property} = remap; path.replaceWith( t.JSXMemberExpression( t.JSXIdentifier(object.name),
+ 19 other calls in file
GitHub: arif98741/parcel
![arif98741 profile picture](/arif98741.png?size=40)
73 74 75 76 77 78 79 80 81 82
const parts = Array.isArray(match) ? match : match.split('.'); const nodes = []; let node; for (node = member; types.isMemberExpression(node); node = node.object) { nodes.push(node.property); } nodes.push(node);
+ 11 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)