How to use the isArrowFunctionExpression function from babel-types

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

92
93
94
95
96
97
98
99
100
101
) {
  return node.body.some(statement => hasBinding(statement, name));
} else if (
  babelTypes.isFunctionDeclaration(node) ||
  babelTypes.isFunctionExpression(node) ||
  babelTypes.isArrowFunctionExpression(node)
) {
  return (
    (node.id !== null && node.id.name === name) ||
    node.params.some(
fork icon0
star icon49
watch icon1

+ 5 other calls in file

3
4
5
6
7
8
9
10
11
12
module.exports = parseNode;

function parseNode(contextNode) {
  if (
    t.isFunctionExpression(contextNode) ||
    t.isArrowFunctionExpression(contextNode) ||
    t.isFunctionDeclaration(contextNode) ||
    t.isObjectMethod(contextNode)
  ) {
    return parseFunctionExpression(contextNode);
fork icon3
star icon6
watch icon1

+ 7 other calls in file

1
2
3
4
5
6
7
8
9
10

const ANONYMOUS_FUNCTION = 'anonymous function';

const isNodeTypeAFunction = n =>
        t.isFunctionDeclaration(n) ||
        t.isArrowFunctionExpression(n) ||
        t.isClassMethod(n) ||
        t.isFunctionExpression(n);

// What to do with declareFunction type?
fork icon2
star icon60
watch icon3

100
101
102
103
104
105
106
107
108
109
) {
  return node.body.some(statement => hasBinding(statement, name));
} else if (
  types.isFunctionDeclaration(node) ||
  types.isFunctionExpression(node) ||
  types.isArrowFunctionExpression(node)
) {
  return (
    (node.id !== null && node.id.name === name) ||
    node.params.some(
fork icon0
star icon1
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)