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)
9
40
4
+ 23 other calls in file
GitHub: jaredly/graphql-flow
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') {
1
4
2
+ 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()]));
0
0
0
+ 2 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)