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.8.0 to 4.9.0

lib/convert-export-declaration.js

9

lib/estree-to-babel.js
'use strict';
const traverse = require('@babel/traverse').default;
const {isObjectExpression} = require('@babel/types');
const {
isObjectExpression,
isExportDeclaration,
} = require('@babel/types');

@@ -13,2 +16,3 @@ const traverseObjectExpression = require('./traverse-object-expression');

const convertImportDeclaration = require('./convert-import-declaration');
const convertExportDeclaration = require('./convert-export-declaration');
const {

@@ -59,2 +63,5 @@ convertTSClassImplements,

if (isExportDeclaration(path))
return convertExportDeclaration(path);
if (type === 'ChainExpression')

@@ -61,0 +68,0 @@ return convertChainExpression(path);

7

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

@@ -44,3 +45,3 @@ "description": "convert estree ast to babel",

"eslint-plugin-node": "^11.0.0",
"eslint-plugin-putout": "^11.11.0",
"eslint-plugin-putout": "^13.6.0",
"espree": "^9.0.0",

@@ -50,3 +51,3 @@ "estree-util-attach-comments": "^2.0.0",

"nodemon": "^2.0.2",
"putout": "^22.1.1",
"putout": "^24.2.2",
"supertape": "^6.0.5",

@@ -53,0 +54,0 @@ "typescript": "^4.5.2"

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

Convert [`ESTree`](https://github.com/estree/estree) compatible `JavaScript AST` to [`Babel AST`](https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md).
Convert [`ESTree`](https://github.com/estree/estree)-compatible `JavaScript AST` to [`Babel AST`](https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md).

@@ -29,3 +29,3 @@ To use parsers like:

- `Property` of `ObjectExpression` called `ObjectProperty`;
- `Property` of `ObjectExpression` and `ObjectPattern` called `ObjectProperty`;
- `FunctionExpression` of a `Property` located in `ObjectMethod` node;

@@ -40,21 +40,14 @@ - `File` node;

- `OptionalMemberExpression` and `OptionalCallExpression` instead of `ChainExpression`;
- `ImportDeclaration` has `assertions`;
- `ImportDeclaration` and `ExportNamedDeclaration` has `assertions`;
- etc...
Also `@babel/parser` has differences with [typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree):
Also [`@babel/parser`](https://babeljs.io/docs/en/babel-parser) has differences with [`typescript-estree`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree):
- `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`;
- `TSQualifiedName` instead of `MemberExpression` in `TSInterfaceHeritage`;
- `TSDeclaredMethod` with `abstract=true` instead of `TSAbstractMethodDefinition`;
- etc...

@@ -61,0 +54,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