How to use the isTSTypeLiteral function from @babel/types

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

52
53
54
55
56
57
58
59
60
61
    const value = node.literal.value;
    const type = typeof value;
    return type.replace(/^./, (c) => c.toUpperCase());
}
if (t.isTSAnyKeyword(node) || t.isTSTypeReference(node) ||
    t.isTSTypeLiteral(node)) {
    // field: any;
    // field: MyInterface;
    // field: { prop: string };
    return "Object";
fork icon0
star icon0
watch icon1

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