How to use the createTSUnionType function from @babel/types
Find comprehensive JavaScript @babel/types.createTSUnionType code examples handpicked from public code repositorys.
52 53 54 55 56 57 58 59 60 61
if (!types.length) { return; } if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) { return t.createTSUnionType(types); } if (t.createFlowUnionType) { return t.createFlowUnionType(types);
0
1
1
+ 5 other calls in file
112 113 114 115 116 117 118 119 120 121 122 123 124
function LogicalExpression() { const argumentTypes = [this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]; if (t.isTSTypeAnnotation(argumentTypes[0]) && t.createTSUnionType) { return t.createTSUnionType(argumentTypes); } if (t.createFlowUnionType) { return t.createFlowUnionType(argumentTypes);
0
0
0
@babel/types.identifier is the most popular function in @babel/types (20936 examples)