-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
When transforming ast it is sometimes easier to perform mutable changes converting one type of node into another. It would be helpful to provide convert functions like:
function convertToClass(node: SelectorNode, options: {preserveNodes?: boolean}) {
const castNode = node as Class;
castNode.type = `class`;
if(options.preserveNodes) {
delete castNode.nodes;
}
castNode.dotComments = [];
return castNode;
}