🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

flow-parser

Package Overview
Dependencies
Maintainers
7
Versions
422
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-parser - npm Package Compare versions

Comparing version
0.319.0
to
0.320.0
+11
-3
oxidized/babel/TransformESTreeToBabel.js

@@ -33,2 +33,3 @@ 'use strict';

ClassPrivateProperty: ['key', 'value', 'typeAnnotation', 'variance'],
DeclareVariable: ['id'],
Directive: ['value'],

@@ -439,7 +440,14 @@ DirectiveLiteral: [],

function mapDeclareVariable(node) {
if (node.kind != null) {
delete node.kind;
var _babelNode$declaratio;
const babelNode = node;
if (babelNode.id == null && Array.isArray(babelNode.declarations) && ((_babelNode$declaratio = babelNode.declarations[0]) == null ? void 0 : _babelNode$declaratio.id) != null) {
babelNode.id = babelNode.declarations[0].id;
}
return node;
delete babelNode.declarations;
delete babelNode.kind;
delete babelNode.implicitDeclare;
return babelNode;
}

@@ -446,0 +454,0 @@

@@ -43,15 +43,28 @@ 'use strict';

function declareVariableDeclarator(id, node) {
return {
type: 'VariableDeclarator',
id,
init: null,
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
};
}
function mapDeclareEnum(node) {
const id = nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
});
return {
type: 'DeclareVariable',
kind: 'const',
id: nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
}),
declarations: [declareVariableDeclarator(id, node)],
implicitDeclare: false,
loc: node.loc,

@@ -64,14 +77,16 @@ range: node.range,

function mapDeclareNamespace(node) {
const id = nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
});
return {
type: 'DeclareVariable',
kind: 'const',
id: nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
}),
declarations: [declareVariableDeclarator(id, node)],
implicitDeclare: false,
loc: node.loc,

@@ -78,0 +93,0 @@ range: node.range,

@@ -26,20 +26,33 @@ 'use strict';

function declareVariableDeclarator(id, node) {
return {
type: 'VariableDeclarator',
id,
init: null,
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
};
}
function mapDeclareComponent(node) {
return {
type: 'DeclareVariable',
id: nodeWith(node.id, {
const id = nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: {
type: 'AnyTypeAnnotation',
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
},
type: 'AnyTypeAnnotation',
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
}
}),
},
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
}
});
return {
type: 'DeclareVariable',
declarations: [declareVariableDeclarator(id, node)],
kind: 'const',
implicitDeclare: false,
loc: node.loc,

@@ -46,0 +59,0 @@ range: node.range,

@@ -819,4 +819,5 @@ 'use strict';

loc: this.addEmptyLoc(),
id: this.deserializeNode(),
kind: this.deserializeString()
declarations: this.deserializeNodeList(),
kind: this.deserializeString(),
implicitDeclare: this.deserializeBoolean()
};

@@ -828,2 +829,3 @@ }, function () {

id: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean(),
predicate: this.deserializeNode()

@@ -840,3 +842,4 @@ };

mixins: this.deserializeNodeList(),
body: this.deserializeNode()
body: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -851,3 +854,4 @@ }, function () {

rendersType: this.deserializeNode(),
typeParameters: this.deserializeNode()
typeParameters: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -858,3 +862,4 @@ }, function () {

loc: this.addEmptyLoc(),
id: this.deserializeNode()
id: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -881,3 +886,4 @@ }, function () {

specifiers: this.deserializeNodeList(),
source: this.deserializeNode()
source: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -888,3 +894,4 @@ }, function () {

loc: this.addEmptyLoc(),
source: this.deserializeNode()
source: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -895,4 +902,7 @@ }, function () {

loc: this.addEmptyLoc(),
global: this.deserializeBoolean(),
id: this.deserializeNode(),
body: this.deserializeNode()
body: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean(),
keyword: this.deserializeString()
};

@@ -906,3 +916,4 @@ }, function () {

body: this.deserializeNode(),
extends: this.deserializeNodeList()
extends: this.deserializeNodeList(),
implicitDeclare: this.deserializeBoolean()
};

@@ -915,3 +926,4 @@ }, function () {

typeParameters: this.deserializeNode(),
right: this.deserializeNode()
right: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -923,3 +935,4 @@ }, function () {

id: this.deserializeNode(),
body: this.deserializeNode()
body: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -1712,3 +1725,4 @@ }, function () {

upperBound: this.deserializeNode(),
supertype: this.deserializeNode()
supertype: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -1715,0 +1729,0 @@ }, function () {

@@ -54,3 +54,3 @@ 'use strict';

DeclareTypeAlias: ['id', 'typeParameters', 'right'],
DeclareVariable: ['id'],
DeclareVariable: ['declarations'],
DeclaredPredicate: ['value'],

@@ -57,0 +57,0 @@ Decorator: ['expression'],

@@ -33,2 +33,3 @@ 'use strict';

ClassPrivateProperty: ['key', 'value', 'typeAnnotation', 'variance'],
DeclareVariable: ['id'],
Directive: ['value'],

@@ -439,7 +440,14 @@ DirectiveLiteral: [],

function mapDeclareVariable(node) {
if (node.kind != null) {
delete node.kind;
var _babelNode$declaratio;
const babelNode = node;
if (babelNode.id == null && Array.isArray(babelNode.declarations) && ((_babelNode$declaratio = babelNode.declarations[0]) == null ? void 0 : _babelNode$declaratio.id) != null) {
babelNode.id = babelNode.declarations[0].id;
}
return node;
delete babelNode.declarations;
delete babelNode.kind;
delete babelNode.implicitDeclare;
return babelNode;
}

@@ -446,0 +454,0 @@

@@ -43,15 +43,28 @@ 'use strict';

function declareVariableDeclarator(id, node) {
return {
type: 'VariableDeclarator',
id,
init: null,
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
};
}
function mapDeclareEnum(node) {
const id = nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
});
return {
type: 'DeclareVariable',
kind: 'const',
id: nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
}),
declarations: [declareVariableDeclarator(id, node)],
implicitDeclare: false,
loc: node.loc,

@@ -64,14 +77,16 @@ range: node.range,

function mapDeclareNamespace(node) {
const id = nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
});
return {
type: 'DeclareVariable',
kind: 'const',
id: nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: createAnyTypeAnnotation(node.body),
loc: node.body.loc,
range: node.body.range,
parent: EMPTY_PARENT
}
}),
declarations: [declareVariableDeclarator(id, node)],
implicitDeclare: false,
loc: node.loc,

@@ -78,0 +93,0 @@ range: node.range,

@@ -26,20 +26,33 @@ 'use strict';

function declareVariableDeclarator(id, node) {
return {
type: 'VariableDeclarator',
id,
init: null,
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
};
}
function mapDeclareComponent(node) {
return {
type: 'DeclareVariable',
id: nodeWith(node.id, {
const id = nodeWith(node.id, {
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: {
type: 'TypeAnnotation',
typeAnnotation: {
type: 'AnyTypeAnnotation',
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
},
type: 'AnyTypeAnnotation',
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
}
}),
},
loc: node.loc,
range: node.range,
parent: EMPTY_PARENT
}
});
return {
type: 'DeclareVariable',
declarations: [declareVariableDeclarator(id, node)],
kind: 'const',
implicitDeclare: false,
loc: node.loc,

@@ -46,0 +59,0 @@ range: node.range,

@@ -819,4 +819,5 @@ 'use strict';

loc: this.addEmptyLoc(),
id: this.deserializeNode(),
kind: this.deserializeString()
declarations: this.deserializeNodeList(),
kind: this.deserializeString(),
implicitDeclare: this.deserializeBoolean()
};

@@ -828,2 +829,3 @@ }, function () {

id: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean(),
predicate: this.deserializeNode()

@@ -840,3 +842,4 @@ };

mixins: this.deserializeNodeList(),
body: this.deserializeNode()
body: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -851,3 +854,4 @@ }, function () {

rendersType: this.deserializeNode(),
typeParameters: this.deserializeNode()
typeParameters: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -858,3 +862,4 @@ }, function () {

loc: this.addEmptyLoc(),
id: this.deserializeNode()
id: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -881,3 +886,4 @@ }, function () {

specifiers: this.deserializeNodeList(),
source: this.deserializeNode()
source: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -888,3 +894,4 @@ }, function () {

loc: this.addEmptyLoc(),
source: this.deserializeNode()
source: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -895,4 +902,7 @@ }, function () {

loc: this.addEmptyLoc(),
global: this.deserializeBoolean(),
id: this.deserializeNode(),
body: this.deserializeNode()
body: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean(),
keyword: this.deserializeString()
};

@@ -906,3 +916,4 @@ }, function () {

body: this.deserializeNode(),
extends: this.deserializeNodeList()
extends: this.deserializeNodeList(),
implicitDeclare: this.deserializeBoolean()
};

@@ -915,3 +926,4 @@ }, function () {

typeParameters: this.deserializeNode(),
right: this.deserializeNode()
right: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -923,3 +935,4 @@ }, function () {

id: this.deserializeNode(),
body: this.deserializeNode()
body: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -1712,3 +1725,4 @@ }, function () {

upperBound: this.deserializeNode(),
supertype: this.deserializeNode()
supertype: this.deserializeNode(),
implicitDeclare: this.deserializeBoolean()
};

@@ -1715,0 +1729,0 @@ }, function () {

@@ -54,3 +54,3 @@ 'use strict';

DeclareTypeAlias: ['id', 'typeParameters', 'right'],
DeclareVariable: ['id'],
DeclareVariable: ['declarations'],
DeclaredPredicate: ['value'],

@@ -57,0 +57,0 @@ Decorator: ['expression'],

{
"name": "flow-parser",
"version": "0.319.0",
"version": "0.320.0",
"description": "JavaScript parser written in OCaml. Produces ESTree AST",

@@ -26,3 +26,3 @@ "homepage": "https://flow.org",

"dependencies": {
"flow-estree": "0.319.0"
"flow-estree": "0.320.0"
},

@@ -29,0 +29,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display