How to use the arrayTypeAnnotation function from @babel/types

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

25
26
27
28
29
30
31
32
33
34
}

buildUnionOfTypesFromLiteral(types/*: string*/, separator/*: string*/) {
  const reduced = types.split(separator).reduce((r, v) => [...r, v.trim()], [])

  return bt.arrayTypeAnnotation(this.buildNativeType(reduced))
}

buildInterface(object/*: Interface*/) {
  const fields = Object.keys(object.fields)
fork icon9
star icon40
watch icon4

+ 23 other calls in file

94
95
96
97
98
99
100
101
102
103
      console.log('scalar', type.name)
      return t.anyTypeAnnotation();
  }
}
if (type.kind === 'LIST') {
  return t.arrayTypeAnnotation(
    typeToFlow(type.ofType, selection)
  )
}
if (type.kind === 'UNION') {
fork icon1
star icon4
watch icon2

+ 15 other calls in file

205
206
207
208
209
210
211
212
213
214
const {
  callee
} = this.node;

if (isObjectKeys(callee)) {
  return t.arrayTypeAnnotation(t.stringTypeAnnotation());
} else if (isArrayFrom(callee) || isObjectValues(callee)) {
  return t.arrayTypeAnnotation(t.anyTypeAnnotation());
} else if (isObjectEntries(callee)) {
  return t.arrayTypeAnnotation(t.tupleTypeAnnotation([t.stringTypeAnnotation(), t.anyTypeAnnotation()]));
fork icon0
star icon0
watch icon0

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