How to use the isReferenced function from babel-types

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

32
33
34
35
36
37
38
39
40
41
Identifier(node, asset, ancestors) {
  let parent = ancestors[ancestors.length - 2];
  if (
    VARS.hasOwnProperty(node.name) &&
    !asset.globals.has(node.name) &&
    types.isReferenced(node, parent)
  ) {
    asset.globals.set(node.name, VARS[node.name](asset));
  }
},
fork icon0
star icon3
watch icon3

+ 13 other calls in file

29
30
31
32
33
34
35
36
37
  }
},

Identifier(node, asset, ancestors) {
  let parent = ancestors[ancestors.length - 2];
  if (VARS.hasOwnProperty(node.name) && !asset.globals.has(node.name) && types.isReferenced(node, parent)) {
    asset.globals.set(node.name, VARS[node.name](asset));
  }
},
fork icon0
star icon0
watch icon2

+ 9 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)