flow-remove-types
Advanced tools
Comparing version 2.248.1 to 2.249.0
16
index.js
@@ -159,3 +159,2 @@ /** | ||
TypeParameterDeclaration: removeNode, | ||
TypeParameterInstantiation: removeNode, | ||
InferredPredicate: removeInferredPredicateNode, | ||
@@ -172,7 +171,3 @@ OpaqueType: removeNode, | ||
removeNode(context, ast.tokens[typeIdx - 1]); // `as` token | ||
if (node.typeAnnotation.type === 'GenericTypeAnnotation') { | ||
removeNode(context, ast.tokens[typeIdx]); | ||
} else { | ||
removeNode(context, node.typeAnnotation); | ||
} | ||
removeNode(context, node.typeAnnotation); | ||
}, | ||
@@ -316,2 +311,9 @@ | ||
}, | ||
TypeParameterInstantiation: function (context, node, ast, parent) { | ||
// prevent interference with asExpression removal | ||
if (parent.type !== 'GenericTypeAnnotation') { | ||
removeNode(context, node); | ||
} | ||
}, | ||
}; | ||
@@ -567,3 +569,3 @@ | ||
var visitFn = visitor[node.type]; | ||
if (visitFn && visitFn(context, node, ast) === false) { | ||
if (visitFn && visitFn(context, node, ast, parent) === false) { | ||
continue; | ||
@@ -570,0 +572,0 @@ } |
{ | ||
"name": "flow-remove-types", | ||
"version": "2.248.1", | ||
"version": "2.249.0", | ||
"description": "Removes Flow type annotations from JavaScript files with speed and simplicity.", | ||
@@ -5,0 +5,0 @@ "author": { |
44157
711