How to use the tsStringKeyword function from @babel/types

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

39
40
41
42
43
44
45
46
47
48
  if (schema.enum) {
    return t.tsUnionType(
      schema.enum.map((variant) => t.tsLiteralType(t.stringLiteral(variant))),
    );
  }
  return t.tsStringKeyword();
  // add enum
},
number(_schema) {
  return t.tsNumberKeyword();
fork icon2
star icon14
watch icon2

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