How to use the isObjectProperty function from babel-types
Find comprehensive JavaScript babel-types.isObjectProperty code examples handpicked from public code repositorys.
GitHub: btd/documentation
167 168 169 170 171 172 173 174 175 176
} } // /** @lends Foo */{ bar: ... } if (n.isIdentifier(path.node) && n.isObjectProperty(path.parentPath) && n.isObjectExpression(path.parentPath.parentPath)) { // The @lends comment is sometimes attached to the first property rather than // the object expression itself. identifiers = findLendsIdentifiers(path.parentPath.parentPath.node) ||
510
0
2
+ 11 other calls in file
55 56 57 58 59 60 61 62 63 64
plugins: [{ visitor: { ExportDefaultDeclaration(path, state) { if(t.isObjectExpression(path.node.declaration)) { const props = path.node.declaration.properties const methodsNode = props.filter(p => t.isObjectProperty(p) && p.key.name === 'methods').shift() const argus = args.split(',').map(arg => t.Identifier(arg)) const m = t.objectMethod('method', t.Identifier(name), argus, t.BlockStatement([])) if (methodsNode) { methodsNode.value.properties.push(m)
1
3
2
+ 35 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)