How to use the booleanTypeAnnotation function from @babel/types

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

168
169
170
171
172
173
174
175
176
177
 * get object type annotation
 * @param {string} type field type
 */
function getObjectTypeAnnotation(type) {
  if (type.indexOf('DataTypes.BOOLEAN') > -1) {
    return t.booleanTypeAnnotation();
  }
  if (type.indexOf('DataTypes.INTEGER') > -1) {
    return t.numberTypeAnnotation();
  }
fork icon23
star icon115
watch icon4

+ 15 other calls in file

82
83
84
85
86
87
88
89
90
91
buildString() {
  return bt.stringTypeAnnotation()
}

buildBoolean() {
  return bt.booleanTypeAnnotation()
}

buildBooleanLiteral(value/*: boolean*/) {
  const ast = bt.booleanLiteralTypeAnnotation(false)
fork icon9
star icon40
watch icon4

+ 11 other calls in file

73
74
75
76
77
78
79
80
81
82
  validValueId,
  null,
  t.unionTypeAnnotation([
    t.stringTypeAnnotation(),
    t.numberTypeAnnotation(),
    t.booleanTypeAnnotation(),
    stringableValue,
  ]),
);
const validValue = t.genericTypeAnnotation(validValueId);
fork icon1
star icon3
watch icon2

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