estree-to-babel
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -12,5 +12,11 @@ 'use strict'; | ||
tokens, | ||
interpreter, | ||
...program | ||
} = node; | ||
const directives = getDirectives(node); | ||
if (interpreter) | ||
tokens.unshift(getShebangToken(interpreter.value)) | ||
const ast = { | ||
@@ -20,4 +26,3 @@ type: 'File', | ||
...program, | ||
interpreter: null, | ||
directives: getDirectives(node), | ||
directives, | ||
}, | ||
@@ -44,1 +49,32 @@ comments, | ||
} | ||
function getShebangToken(value) { | ||
return { | ||
"type": { | ||
"label": "#!...", | ||
"beforeExpr": false, | ||
"startsExpr": false, | ||
"rightAssociative": false, | ||
"isLoop": false, | ||
"isAssign": false, | ||
"prefix": false, | ||
"postfix": false, | ||
"binop": null, | ||
"updateContext": null | ||
}, | ||
"value": value, | ||
"start": 0, | ||
"end": 19, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 19 | ||
} | ||
} | ||
} | ||
} | ||
{ | ||
"name": "estree-to-babel", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -5,0 +5,0 @@ "description": "convert estree ast to babel", |
@@ -34,3 +34,3 @@ # Estree-to-babel [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
- `ClassPrivateMethod` | ||
- Convert 'use strict' Literal into `Directive` and put into `program.body.directives` | ||
- Convert `use strict` Literal into `Directive` and put it into `program.body.directives` | ||
- etc... | ||
@@ -37,0 +37,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13260
287