flow-node
Advanced tools
Comparing version 2.138.0 to 2.139.0
31
index.js
@@ -184,2 +184,18 @@ /** | ||
FunctionDeclaration: function(context, node) { | ||
if (node.params && node.params.length) { | ||
if (node.params[0].name === 'this') { | ||
return removeNode(context, node.params[0], undefined, node.params[1]); | ||
} | ||
} | ||
}, | ||
FunctionExpression: function(context, node) { | ||
if (node.params && node.params.length) { | ||
if (node.params[0].name === 'this') { | ||
return removeNode(context, node.params[0], undefined, node.params[1]); | ||
} | ||
} | ||
}, | ||
ClassProperty: function(context, node) { | ||
@@ -304,3 +320,3 @@ if (node.declare || (context.ignoreUninitializedFields && !node.value)) { | ||
// in the list. | ||
function removeNode(context, node) { | ||
function removeNode(context, node, _ast, nextInList) { | ||
var removedNodes = context.removedNodes; | ||
@@ -313,2 +329,12 @@ var length = removedNodes.length; | ||
var lineNode = context.pretty ? getTrailingLineNode(context, node) : null; | ||
var commaNode = nextInList | ||
? createNode({ | ||
start: endOf(node), | ||
end: startOf(nextInList), | ||
loc: { | ||
start: endOf(node), | ||
end: startOf(nextInList), | ||
}, | ||
}) | ||
: null; | ||
@@ -327,2 +353,5 @@ while (index > 0 && endOf(removedNodes[index - 1]) > startOf(node)) { | ||
} | ||
if (commaNode) { | ||
removedNodes.push(commaNode); | ||
} | ||
} else { | ||
@@ -329,0 +358,0 @@ if (lineNode) { |
{ | ||
"name": "flow-node", | ||
"version": "2.138.0", | ||
"version": "2.139.0", | ||
"description": "Removes Flow type annotations from JavaScript files with speed and simplicity.", | ||
@@ -46,3 +46,3 @@ "author": { | ||
"dependencies": { | ||
"flow-parser": "^0.138.0", | ||
"flow-parser": "^0.139.0", | ||
"pirates": "^3.0.2", | ||
@@ -49,0 +49,0 @@ "vlq": "^0.2.1" |
41884
652
+ Addedflow-parser@0.139.0(transitive)
- Removedflow-parser@0.138.0(transitive)
Updatedflow-parser@^0.139.0