Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

estree-to-babel

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

estree-to-babel - npm Package Compare versions

Comparing version 4.5.0 to 4.6.0

6

lib/estree-to-babel.js

@@ -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 @@ },

21

lib/ts.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc