Search Terms
isImportTypeAssertionContainer
Suggestion
TypeScript's Compiler APIs include is functions for all kinds of Nodes. For example, isClassDeclaration, isBigIntLiteral, and so on.
In TypeScript 4.7 a new kind of node is introduced: ImportTypeAssertionContainer, but no isImportTypeAssertionContainer predicate function is exposed. For consistency with other kinds of Nodes, TypeScript should arguably also expose such a predicate function.
Use Cases
- Custom Transformers (visiting and transforming Nodes in an AST)
- Working with the Compiler APIs
- etc
Examples
function visitNode (node: TS.Node, context: TS.TransformationContext, typescript: typeof TS): TS.VisitResult<TS.Node> {
if (typescript.isImportTypeAssertionContainer(node) {
return visitImportTypeAssertionContainer(node, context, typescript);
}
else if (...) {
....
}
}
Checklist
My suggestion meets these guidelines:
Search Terms
isImportTypeAssertionContainer
Suggestion
TypeScript's Compiler APIs include
isfunctions for all kinds of Nodes. For example,isClassDeclaration,isBigIntLiteral, and so on.In TypeScript 4.7 a new kind of node is introduced:
ImportTypeAssertionContainer, but noisImportTypeAssertionContainerpredicate function is exposed. For consistency with other kinds of Nodes, TypeScript should arguably also expose such a predicate function.Use Cases
Examples
Checklist
My suggestion meets these guidelines: