How to use the stringTypeAnnotation function from @babel/types

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

177
178
179
180
181
182
183
184
185
186
}
if (type.indexOf('DataTypes.BIGINT') > -1) {
  return t.numberTypeAnnotation();
}
if (type.indexOf('DataTypes.STRING') > -1) {
  return t.stringTypeAnnotation();
}
if (type.indexOf('DataTypes.CHAR') > -1) {
  return t.stringTypeAnnotation();
}
fork icon23
star icon115
watch icon4

+ 63 other calls in file

78
79
80
81
82
83
84
85
86
87
buildInteger() {
  return bt.numberTypeAnnotation()
}

buildString() {
  return bt.stringTypeAnnotation()
}

buildBoolean() {
  return bt.booleanTypeAnnotation()
fork icon9
star icon40
watch icon4

+ 11 other calls in file

71
72
73
74
75
76
77
78
79
80
const validValueId = t.identifier('ValidValue');
const validValueType = t.declareTypeAlias(
  validValueId,
  null,
  t.unionTypeAnnotation([
    t.stringTypeAnnotation(),
    t.numberTypeAnnotation(),
    t.booleanTypeAnnotation(),
    stringableValue,
  ]),
fork icon1
star icon3
watch icon2

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