How to use the isClassDeclaration function from babel-types

Find comprehensive JavaScript babel-types.isClassDeclaration code examples handpicked from public code repositorys.

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';
fork icon510
star icon0
watch icon2

+ 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) {
fork icon0
star icon2
watch icon1

+ 7 other calls in file

Other functions in babel-types

Sorted by popularity

function icon

babel-types.identifier is the most popular function in babel-types (4076 examples)