How to use the TYPES function from @babel/types

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

126
127
128
129
130
131
132
133
134
135
      `declare export { _${functionName} as ${functionName} }`,
    );
  }
}

for (let i = 0; i < t.TYPES.length; i++) {
  const type = t.TYPES[i];
  let decl = `declare export function is${type}(node: ?Object, opts?: ?Object): boolean`;

  if (t.NODE_FIELDS[type]) {
fork icon625
star icon3
watch icon1

+ 171 other calls in file

232
233
234
235
236
237
238
239
240
241
242
243
  };
}


for (const type of Object.keys(virtualTypes)) {
  if (type[0] === "_") continue;
  if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);
  const virtualType = virtualTypes[type];


  NodePath.prototype[`is${type}`] = function (opts) {
    return virtualType.checkPath(this, opts);
fork icon0
star icon1
watch icon1

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