How to use the anyTypeAnnotation function from @babel/types

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

203
204
205
206
207
208
209
210
211
212
    return t.numberTypeAnnotation();
  }
  if (type.indexOf('DataTypes.UUIDV4') > -1) {
    return t.stringTypeAnnotation();
  }
  return t.anyTypeAnnotation();
}


module.exports = {
fork icon23
star icon115
watch icon4

+ 15 other calls in file

46
47
48
49
50
51
52
53
54
55
}
const name = selection.name.value
if (!type.fieldsByName[name]) {
  console.warn('Unknown field: ' + name)
  return t.objectTypeProperty(t.identifier(name),
  t.anyTypeAnnotation()
    )
}
const typeField = type.fieldsByName[name];
return t.objectTypeProperty(t.identifier(name), typeToFlow(typeField.type, selection))
fork icon1
star icon4
watch icon2

+ 79 other calls in file

85
86
87
88
89
90
91
92
93
      return t.numberTypeAnnotation();
    case 'Boolean':
      return t.booleanTypeAnnotation();
    default:
      return customType == null
        ? t.anyTypeAnnotation()
        : t.genericTypeAnnotation(t.identifier(customType));
  }
}
fork icon0
star icon1
watch icon9

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