How to use the isClassDeclaration function from babel-types
Find comprehensive JavaScript babel-types.isClassDeclaration code examples handpicked from public code repositorys.
GitHub: btd/documentation
203 204 205 206 207 208 209 210 211 212
} // class Foo { bar() { } } if (n.isClassMethod(path) && n.isClassBody(path.parentPath) && n.isClassDeclaration(path.parentPath.parentPath)) { identifiers = [path.parentPath.parentPath.node.id.name]; var scope = 'instance'; if (path.node.static == true) { scope = 'static';
510
0
2
+ 3 other calls in file
108 109 110 111 112 113 114 115 116 117
); } function findClassDeclaration(ast, name) { return ast.program.body.find( stmt => types.isClassDeclaration(stmt) && stmt.id && stmt.id.name === name ); } function findDefaultExportDeclaration(ast) {
0
2
1
+ 7 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)