Socket
Socket
Sign inDemoInstall

flow2ts

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow2ts - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

package.json
{
"name": "flow2ts",
"version": "1.0.0",
"version": "1.1.0",
"keywords": [

@@ -5,0 +5,0 @@ "flow",

@@ -342,2 +342,3 @@ import { NodePath } from '@babel/traverse';

body: NodePath<t.ObjectTypeAnnotation>,
additionalExtends: t.TSExpressionWithTypeArguments[] = [],
): t.BaseNode => {

@@ -352,3 +353,3 @@ const typeParameters = convertTypeParameters(typeParametersIn);

const tsTypeParameters = convertTypeParameterInstantiation(argument.get('typeParameters'));
return t.tsExpressionWithTypeArguments(argument.node.id, tsTypeParameters);
return t.tsExpressionWithTypeArguments(t.identifier(argument.node.id.name), tsTypeParameters);
}

@@ -360,4 +361,5 @@ }

const bodyOut = t.tsInterfaceBody(convertAllProperties(body));
const allExtends = additionalExtends.concat(extend);
const decl = t.tsInterfaceDeclaration(id, typeParameters, extend.length === 0 ? null : extend, bodyOut);
const decl = t.tsInterfaceDeclaration(id, typeParameters, allExtends.length === 0 ? null : allExtends, bodyOut);
decl.loc = id.loc;

@@ -367,2 +369,9 @@ return decl;

const convertInterfaceExtends = (
path: NodePath<t.InterfaceExtends>,
): t.TSExpressionWithTypeArguments => {
const tsTypeParameters = convertTypeParameterInstantiation(path.get('typeParameters'));
return t.tsExpressionWithTypeArguments(t.identifier(path.node.id.name), tsTypeParameters);
}
const convertInterfaceDeclaration = (path: NodePath<t.InterfaceDeclaration>) => convertInterface(

@@ -372,2 +381,5 @@ path.node.id,

path.get('body'),
(path.node as any).extends == null
? []
: (path.node as any).extends.map((_: any, idx: number) => convertInterfaceExtends(path.get(`extends.${idx}`))),
);

@@ -374,0 +386,0 @@

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