How to use the isObjectMethod function from @babel/types
Find comprehensive JavaScript @babel/types.isObjectMethod code examples handpicked from public code repositorys.
GitHub: yandex/reselector
![yandex profile picture](/yandex.png?size=40)
83 84 85 86 87 88 89 90 91 92
isComponent = isComponent || ( t.isArrowFunctionExpression(node) || t.isFunctionExpression(node) || t.isClassMethod(node) || t.isObjectMethod(node) || t.isFunctionDeclaration(node) ) if (!componentNode && isComponent) {
+ 17 other calls in file
115 116 117 118 119 120 121 122 123
throw `Cannot resolve arguments for ${node.type}`; }; const getPropertyDescriptor = async ({ node, ast, cwd }) => { const valueNode = types.isObjectMethod(node) ? node : node.value; const descriptor = await createDescriptor({ node: valueNode, ast, cwd }); const comments = getComments(node); const name = node.key.name;
+ 3 other calls in file
GitHub: jiangjing1994/fishhook
42 43 44 45 46 47 48 49 50 51
) { return node.value } else if ( types.isFunctionExpression(node) || types.isArrowFunctionExpression(node) || types.isObjectMethod(node) ) { try { let code = generate.default(types.isObjectMethod(node) ? node.body : node).code let fun = eval(`0,${types.isObjectMethod(node) ? 'function ()' : ''} ${code}`)
125 126 127 128 129 130 131 132 133 134 135
scope, id }, localBinding = false) { if (node.id) return; if ((t.isObjectProperty(parent) || t.isObjectMethod(parent, { kind: "method" })) && (!parent.computed || t.isLiteral(parent.key))) { id = parent.key; } else if (t.isVariableDeclarator(parent)) {
+ 8 other calls in file
GitHub: EraserCN/node_modules
244 245 246 247 248 249 250 251 252 253
if (t.isAssignmentExpression(parent)) { node = parent.left; } else if (t.isVariableDeclarator(parent)) { node = parent.id; } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) { node = node.key; } const parts = [];
24 25 26 27 28 29 30 31 32 33
async: true }) || t.isFunctionExpression(node, { async: true }) || t.isObjectMethod(node, { async: true }); module.exports = function (source) { let options = this.getOptions();
GitHub: charoenlap/af1app
54 55 56 57 58 59 60 61 62 63
throw file.buildCodeFrameError(node, "Key conflict with sibling node"); } let key, value; if (t.isObjectProperty(node) || t.isObjectMethod(node) || t.isClassMethod(node)) { key = t.toComputedKey(node, node.key); } if (t.isProperty(node)) {
@babel/types.identifier is the most popular function in @babel/types (20936 examples)