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.4.0 to 4.5.0

9

lib/estree-to-babel.js

@@ -13,3 +13,6 @@ 'use strict';

const convertImportDeclaration = require('./convert-import-declaration');
const {convertTSClassImplements} = require('./ts');
const {
convertTSClassImplements,
convertPropertyDefinition,
} = require('./ts');

@@ -58,2 +61,6 @@ const {convertNodeComments} = require('./comments');

return convertTSClassImplements(path);
if (type === 'PropertyDefinition') {
return convertPropertyDefinition(path);
}
},

@@ -60,0 +67,0 @@ exit(path) {

@@ -6,1 +6,23 @@ 'use strict';

};
module.exports.convertPropertyDefinition = (path) => {
const {node} = path;
if (node.key.type === 'PrivateIdentifier') {
const {key} = node;
node.type = 'ClassPrivateProperty';
node.key = {
type: 'PrivateName',
id: {
...key,
type: 'Identifier',
},
};
return;
}
path.node.type = 'ClassProperty';
};

2

package.json
{
"name": "estree-to-babel",
"version": "4.4.0",
"version": "4.5.0",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

@@ -5,0 +5,0 @@ "description": "convert estree ast to babel",

@@ -15,5 +15,5 @@ # Estree-to-babel [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]

- [acorn](https://github.com/acornjs/acorn)
- [cherow](https://github.com/cherow/cherow)
- [espree](https://github.com/eslint/espree)
- [`acorn`](https://github.com/acornjs/acorn)
- [`cherow`](https://github.com/cherow/cherow)
- [`espree`](https://github.com/eslint/espree)
- etc...

@@ -23,7 +23,7 @@

- [@babel/traverse](https://babeljs.io/docs/en/babel-traverse)
- [@babel/types](https://babeljs.io/docs/en/babel-types)
- [`@babel/traverse`](https://babeljs.io/docs/en/babel-traverse)
- [`@babel/types`](https://babeljs.io/docs/en/babel-types)
- etc...
The thing is `@babel/parser` has a [little differences](https://babeljs.io/docs/en/babel-parser#output) with `estree` standard:
The thing is [`@babel/parser`](https://babeljs.io/docs/en/babel-parser) has a [little differences](https://babeljs.io/docs/en/babel-parser#output) with `estree` standard:

@@ -43,5 +43,8 @@ - `Property` of `ObjectExpression` called `ObjectProperty`;

Also ([typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree) has differenceswith `@babel/parser`:
Also [typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree) has differences with `@babel/parser`:
-`TSClassImplements` used instead of `TSExpressionWithTypeArguments
- `TSClassImplements` used instead of `TSExpressionWithTypeArguments`
- `ClassPrivateProperty` instead of `PropertyDefinition` when `key.type=PrivateName`;
- `ClasseProperty` instead of `PropertyDefinition` when `key.type=TSPrivateIdentifier`;
- 'PrivateName` instead of `TSPrivateIdentifier`;
- etc...

@@ -48,0 +51,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