estree-to-babel
Advanced tools
Comparing version 4.7.0 to 4.8.0
@@ -16,2 +16,3 @@ 'use strict'; | ||
convertTSInterfaceHeritage, | ||
convertTSAbstractMethodDefinition, | ||
convertPropertyDefinition, | ||
@@ -61,4 +62,4 @@ convertPrivateIdentifier, | ||
if (type === 'TSClassImplements') | ||
return convertTSClassImplements(path); | ||
if (type === 'TSAbstractMethodDefinition') | ||
return convertTSAbstractMethodDefinition(path); | ||
@@ -73,2 +74,5 @@ if (type === 'TSInterfaceHeritage') | ||
return convertPrivateIdentifier(path); | ||
if (type === 'TSClassImplements') | ||
return convertTSClassImplements(path); | ||
}, | ||
@@ -75,0 +79,0 @@ exit(path) { |
@@ -45,2 +45,29 @@ 'use strict'; | ||
module.exports.convertTSAbstractMethodDefinition = (path) => { | ||
const {node} = path; | ||
const { | ||
generator, | ||
async, | ||
params, | ||
id, | ||
returnType, | ||
} = node.value; | ||
const newNode = { | ||
...node, | ||
abstract: true, | ||
generator, | ||
async, | ||
params, | ||
id, | ||
returnType, | ||
type: 'TSDeclareMethod', | ||
}; | ||
delete newNode.value; | ||
path.replaceWith(newNode); | ||
}; | ||
function createPrivateName(node) { | ||
@@ -47,0 +74,0 @@ return { |
{ | ||
"name": "estree-to-babel", | ||
"version": "4.7.0", | ||
"version": "4.8.0", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -5,0 +5,0 @@ "description": "convert estree ast to babel", |
@@ -44,8 +44,15 @@ # Estree-to-babel [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
- `TSExpressionWithTypeArguments` instead of `TSClassImplements`; | ||
- `ClassPrivateProperty` instead of `PropertyDefinition` when `key.type=PrivateName`; | ||
- `ClasseProperty` instead of `PropertyDefinition` when `key.type=Identifier`; | ||
- `PrivateName` instead of `PrivateIdentifier`; | ||
- `TSInterfaceHeritage` instead of `TSExpressionWithTypeArguments`; | ||
- `MemberExpression` instead of `TSQualifiedName` in `TSInterfaceHeritage`; | ||
- `TSQualifiedName` instead of `MemberExpression` in `TSInterfaceHeritage`; | ||
- `TSDeclaredMethod` with `abstract=true` instead of `TSAbstractMethodDefinition`; | ||
- etc... | ||
@@ -52,0 +59,0 @@ |
Sorry, the diff of this file is not supported yet
21669
364
90