How to use the tSUnionType function from @babel/types
Find comprehensive JavaScript @babel/types.tSUnionType code examples handpicked from public code repositorys.
8 9 10 11 12 13 14 15 16 17
buildUnion(object/*: Union */) { const ast = bt.exportNamedDeclaration( bt.tSTypeAliasDeclaration( bt.identifier(object.name), undefined, bt.tSUnionType(object.variants.map((name) => ( bt.tSTypeReference(bt.identifier(name)) ))) ), [],
9
40
4
+ 3 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)