Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flow-remove-types

Package Overview
Dependencies
Maintainers
2
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-remove-types - npm Package Compare versions

Comparing version 2.220.1 to 2.221.0

25

index.js

@@ -10,3 +10,3 @@ /**

var parse = require('flow-parser').parse;
var parse = require('hermes-parser').parse;
var vlq = require('vlq');

@@ -61,12 +61,3 @@

// This parse configuration is intended to be as permissive as possible.
var ast = parse(source, {
esproposal_decorators: true,
esproposal_class_instance_fields: true,
esproposal_class_static_fields: true,
esproposal_export_star_as: true,
esproposal_optional_chaining: true,
esproposal_nullish_coalescing: true,
types: true,
tokens: true,
});
var ast = parse(source, {types: true, tokens: true});

@@ -170,3 +161,3 @@ var removedNodes = [];

TypeParameterInstantiation: removeNode,
InferredPredicate: removeNode,
InferredPredicate: removeInferredPredicateNode,
OpaqueType: removeNode,

@@ -375,2 +366,12 @@ DeclareOpaqueType: removeNode,

function removeInferredPredicateNode(context, node) {
var tokens = context.ast.tokens;
var priorTokenIdx = findTokenIndexAtStartOfNode(tokens, node) - 1;
var token = tokens[priorTokenIdx];
if (token && token.type === 'Punctuator' && token.value === ':') {
removeNode(context, token);
}
return removeNode(context, node);
}
function removeTrailingCommaNode(context, node) {

@@ -377,0 +378,0 @@ var ast = context.ast;

{
"name": "flow-remove-types",
"version": "2.220.1",
"version": "2.221.0",
"description": "Removes Flow type annotations from JavaScript files with speed and simplicity.",

@@ -47,3 +47,3 @@ "author": {

"dependencies": {
"flow-parser": "^0.220.0",
"hermes-parser": "0.17.1",
"pirates": "^3.0.2",

@@ -50,0 +50,0 @@ "vlq": "^0.2.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc