hermes-parser
Advanced tools
@@ -255,2 +255,3 @@ "use strict"; | ||
| case 'ArrowFunctionExpression': | ||
| node.id = null; | ||
| node.expression = node.body.type !== 'BlockStatement'; | ||
@@ -257,0 +258,0 @@ return node; |
+7
-1
@@ -142,2 +142,4 @@ /** | ||
| function parse(code, opts) { | ||
| var _options$transformOpt, _options$transformOpt2; | ||
| const options = getOptions(opts); | ||
@@ -152,3 +154,7 @@ const ast = HermesParser.parse(code, options); | ||
| const loweredESTreeAST = [TransformEnumSyntax.transformProgram, TransformMatchSyntax.transformProgram, TransformComponentSyntax.transformProgram, TransformRecordSyntax.transformProgram, StripFlowTypesForBabel.transformProgram].reduce((ast, transform) => transform(ast, options), estreeAST); | ||
| const loweredESTreeAST = [(_options$transformOpt = options.transformOptions) != null && (_options$transformOpt2 = _options$transformOpt.TransformEnumSyntax) != null && _options$transformOpt2.enable ? TransformEnumSyntax.transformProgram : null, TransformMatchSyntax.transformProgram, TransformComponentSyntax.transformProgram, TransformRecordSyntax.transformProgram, StripFlowTypesForBabel.transformProgram].reduce((ast, transform) => { | ||
| var _transform; | ||
| return (_transform = transform == null ? void 0 : transform(ast, options)) != null ? _transform : ast; | ||
| }, estreeAST); | ||
| return TransformESTreeToBabel.transformProgram(loweredESTreeAST, options); | ||
@@ -155,0 +161,0 @@ } |
@@ -255,2 +255,3 @@ "use strict"; | ||
| case 'ArrowFunctionExpression': | ||
| node.id = null; | ||
| node.expression = node.body.type !== 'BlockStatement'; | ||
@@ -257,0 +258,0 @@ return node; |
@@ -142,2 +142,4 @@ /** | ||
| function parse(code, opts) { | ||
| var _options$transformOpt, _options$transformOpt2; | ||
| const options = getOptions(opts); | ||
@@ -152,3 +154,7 @@ const ast = HermesParser.parse(code, options); | ||
| const loweredESTreeAST = [TransformEnumSyntax.transformProgram, TransformMatchSyntax.transformProgram, TransformComponentSyntax.transformProgram, TransformRecordSyntax.transformProgram, StripFlowTypesForBabel.transformProgram].reduce((ast, transform) => transform(ast, options), estreeAST); | ||
| const loweredESTreeAST = [(_options$transformOpt = options.transformOptions) != null && (_options$transformOpt2 = _options$transformOpt.TransformEnumSyntax) != null && _options$transformOpt2.enable ? TransformEnumSyntax.transformProgram : null, TransformMatchSyntax.transformProgram, TransformComponentSyntax.transformProgram, TransformRecordSyntax.transformProgram, StripFlowTypesForBabel.transformProgram].reduce((ast, transform) => { | ||
| var _transform; | ||
| return (_transform = transform == null ? void 0 : transform(ast, options)) != null ? _transform : ast; | ||
| }, estreeAST); | ||
| return TransformESTreeToBabel.transformProgram(loweredESTreeAST, options); | ||
@@ -155,0 +161,0 @@ } |
+2
-2
| { | ||
| "name": "hermes-parser", | ||
| "version": "0.33.1", | ||
| "version": "0.33.2", | ||
| "description": "A JavaScript parser built from the Hermes engine", | ||
@@ -12,3 +12,3 @@ "main": "dist/index.js", | ||
| "dependencies": { | ||
| "hermes-estree": "0.33.1" | ||
| "hermes-estree": "0.33.2" | ||
| }, | ||
@@ -15,0 +15,0 @@ "devDependencies": { |
+1
-0
@@ -14,2 +14,3 @@ # hermes-parser | ||
| - `TransformEnumSyntax` | ||
| - `enable`: `boolean` - Whether to enable the transform. By default, `false`. | ||
| - `getRuntime` (optional): `() => Expression` - The expression which should be a reference to the Flow Enums runtime. By default, is `require('flow-enums-runtime')`. |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1584100
0.06%17257
0.06%16
6.67%+ Added
- Removed
Updated