Keep comments with specific keywords

This commit is contained in:
sanex3339
2017-12-05 11:13:18 +03:00
parent 5161df4a77
commit 4bde27915f
24 changed files with 285 additions and 6 deletions
+8
View File
@@ -178,6 +178,14 @@ export class NodeGuards {
return Array.isArray((<TNodeWithBlockStatement>node).body);
}
/**
* @param {Node} node
* @returns {boolean}
*/
public static isNodeWithComments (node: ESTree.Node): node is ESTree.Node {
return Boolean(node.leadingComments) || Boolean(node.trailingComments);
}
/**
* @param {Node} node
* @returns {boolean}