flow-remove-types 2.267.0 → 2.269.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +7 -2
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -289,8 +289,13 @@ var removeFlowVisitor = {
289
289
  removeTrailingCommaNode(context, defaultSpecifier);
290
290
  // remove opening brace
291
291
  removeNode(context, context.ast.tokens[idxStart - 1]);
292
- // remove closing brace
293
- removeNode(context, context.ast.tokens[idxEnd + 1]);
292
+ // remove trailing brace
293
+ if (getLabel(context.ast.tokens[idxEnd + 1]) === '}') {
294
+ removeNode(context, context.ast.tokens[idxEnd + 1]);
295
+ } else {
296
+ // last specifier has a trailing comma, skip it
297
+ removeNode(context, context.ast.tokens[idxEnd + 2]);
298
+ }
294
299
  }
295
300
  }
296
301
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-remove-types",
3
- "version": "2.267.0",
3
+ "version": "2.269.1",
4
4
  "description": "Removes Flow type annotations from JavaScript files with speed and simplicity.",
5
5
  "author": {
6
6
  "name": "Flow Team",
@@ -44,7 +44,7 @@
44
44
  "es6"
45
45
  ],
46
46
  "dependencies": {
47
- "hermes-parser": "0.25.1",
47
+ "hermes-parser": "0.28.0",
48
48
  "pirates": "^3.0.2",
49
49
  "vlq": "^0.2.1"
50
50
  },