estree-to-babel
Advanced tools
Comparing version 4.5.0 to 4.6.0
@@ -16,2 +16,3 @@ 'use strict'; | ||
convertPropertyDefinition, | ||
convertPrivateIdentifier, | ||
} = require('./ts'); | ||
@@ -62,4 +63,7 @@ | ||
if (type === 'PropertyDefinition') { | ||
if (type === 'PropertyDefinition') | ||
return convertPropertyDefinition(path); | ||
if (type === 'PrivateIdentifier') { | ||
return convertPrivateIdentifier(path); | ||
} | ||
@@ -66,0 +70,0 @@ }, |
@@ -14,9 +14,3 @@ 'use strict'; | ||
node.type = 'ClassPrivateProperty'; | ||
node.key = { | ||
type: 'PrivateName', | ||
id: { | ||
...key, | ||
type: 'Identifier', | ||
}, | ||
}; | ||
node.key = createPrivateName(key); | ||
@@ -29,1 +23,14 @@ return; | ||
module.exports.convertPrivateIdentifier = (path) => { | ||
path.replaceWith(createPrivateName(path.node)); | ||
}; | ||
function createPrivateName(node) { | ||
return { | ||
type: 'PrivateName', | ||
id: { | ||
...node, | ||
type: 'Identifier', | ||
}, | ||
}; | ||
} |
{ | ||
"name": "estree-to-babel", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -13,5 +13,8 @@ "description": "convert estree ast to babel", | ||
"scripts": { | ||
"wisdom": "madrun wisdom", | ||
"test": "madrun test", | ||
"watch:test": "madrun watch:test", | ||
"lint": "madrun lint", | ||
"fresh:lint": "madrun fresh:lint", | ||
"lint:fresh": "madrun lint:fresh", | ||
"fix:lint": "madrun fix:lint", | ||
@@ -18,0 +21,0 @@ "coverage": "madrun coverage", |
@@ -45,4 +45,4 @@ # Estree-to-babel [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
- `ClassPrivateProperty` instead of `PropertyDefinition` when `key.type=PrivateName`; | ||
- `ClasseProperty` instead of `PropertyDefinition` when `key.type=TSPrivateIdentifier`; | ||
- 'PrivateName` instead of `TSPrivateIdentifier`; | ||
- `ClasseProperty` instead of `PropertyDefinition` when `key.type=PrivateIdentifier`; | ||
- `PrivateName` instead of `PrivateIdentifier`; | ||
- etc... | ||
@@ -49,0 +49,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
19907
324