How to use the isBlock function from babel-types

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

86
87
88
89
90
91
92
93
94
95
if (Array.isArray(node)) {
  return node.some(ancestor => hasBinding(ancestor, name));
} else if (
  babelTypes.isProgram(node) ||
  babelTypes.isBlockStatement(node) ||
  babelTypes.isBlock(node)
) {
  return node.body.some(statement => hasBinding(statement, name));
} else if (
  babelTypes.isFunctionDeclaration(node) ||
fork icon0
star icon49
watch icon0

+ 3 other calls in file

92
93
94
95
96
97
98
99
100
101
if (Array.isArray(node)) {
  return node.some(ancestor => hasBinding(ancestor, name));
} else if (
  types.isProgram(node) ||
  types.isBlockStatement(node) ||
  types.isBlock(node)
) {
  return node.body.some(statement => hasBinding(statement, name));
} else if (
  types.isFunctionDeclaration(node) ||
fork icon0
star icon2
watch icon2

Other functions in babel-types

Sorted by popularity

function icon

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