How to use the getBindingIdentifiers function from @babel/types

Find comprehensive JavaScript @babel/types.getBindingIdentifiers code examples handpicked from public code repositorys.

65
66
67
68
69
70
71
72
73
74
    if (!exports[name].description && prev?.description) {
      exports[name].description = prev.description;
    }
  }
} else {
  let identifiers = t.getBindingIdentifiers(path.node.declaration);
  for (let [index, id] of Object.keys(identifiers).entries()) {
    exports[identifiers[id].name] = processExport(path.get('declaration.declarations')[index]);
    asset.symbols.set(identifiers[id].name, identifiers[id].name);
  }
fork icon726
star icon2
watch icon1

+ 45 other calls in file

33
34
35
36
37
38
39
40
41
42
  }
},

Declaration(node, asset, ancestors) {
  // If there is a global declaration of one of the variables, remove our declaration
  let identifiers = types.getBindingIdentifiers(node);
  for (let id in identifiers) {
    if (VARS.hasOwnProperty(id) && !inScope(ancestors)) {
      // Don't delete entirely, so we don't add it again when the declaration is referenced
      asset.globals.set(id, '');
fork icon0
star icon2
watch icon2

+ 9 other calls in file

452
453
454
455
456
457
458
459
460
461
} else if (declaration) {
  path.replaceWith(declaration);

  let identifiers = t.isIdentifier(declaration.id)
    ? [declaration.id]
    : t.getBindingIdentifiers(declaration);

  for (let id in identifiers) {
    addExport(asset, path, identifiers[id], identifiers[id]);
  }
fork icon0
star icon1
watch icon1

229
230
231
232
233
234
235
236
237
238
239
240
241


  return path;
}


function getBindingIdentifiers(duplicates) {
  return t.getBindingIdentifiers(this.node, duplicates);
}


function getOuterBindingIdentifiers(duplicates) {
  return t.getOuterBindingIdentifiers(this.node, duplicates);
fork icon0
star icon0
watch icon1

+ 23 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 (20936 examples)