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 3.1.1 to 3.2.0

4

lib/estree-to-babel.js

@@ -8,3 +8,2 @@ 'use strict';

const setClassMethod = require('./set-class-method');
const setClassPrivateMethod = require('./set-class-private-method');
const setClassPrivateProperty = require('./set-class-private-property');

@@ -36,5 +35,2 @@ const setClassPrivateName = require('./set-class-private-name');

if (type === 'ClassPrivateMethod')
return setClassPrivateMethod(path);
if (type === 'FieldDefinition')

@@ -41,0 +37,0 @@ return setClassPrivateProperty(path);

32

lib/set-class-method.js
'use strict';
const {classMethod} = require('@babel/types');
const {
isPrivateName,
classPrivateMethod,
classMethod,
} = require('@babel/types');

@@ -23,3 +27,3 @@ const {assign} = Object;

path.replaceWith(classMethod(
const method = getClassMethod({
kind,

@@ -30,5 +34,6 @@ key,

computed,
node.static,
));
nodeStatic: node.static,
});
path.replaceWith(method);
assign(path.node, {

@@ -41,1 +46,20 @@ loc,

function getClassMethod({kind, key, params, body, computed, nodeStatic}) {
if (isPrivateName(key))
return classPrivateMethod(
kind,
key,
params,
body,
computed,
);
return classMethod(
kind,
key,
params,
body,
computed,
nodeStatic,
);
}
{
"name": "estree-to-babel",
"version": "3.1.1",
"version": "3.2.0",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

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

"nyc": "^15.0.0",
"putout": "^14.0.1",
"supertape": "^4.8.1"
"putout": "^15.4.3",
"supertape": "^5.0.0"
},

@@ -49,0 +49,0 @@ "license": "MIT",

# Estree-to-babel [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
[NPMIMGURL]: https://img.shields.io/npm/v/estree-to-babel.svg?style=flat&longCache=true
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/estree-to-babel/master.svg?style=flat&longCache=true
[BuildStatusURL]: https://github.com/coderaiser/estree-to-babel/actions?query=workflow%3A%22Node+CI%22 "Build Status"
[BuildStatusIMGURL]: https://github.com/coderaiser/estree-to-babel/workflows/Node%20CI/badge.svg
[DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/estree-to-babel.svg?style=flat&longCache=true

@@ -34,3 +35,3 @@ [NPMURL]: https://npmjs.org/package/estree-to-babel "npm"

- `ClassMethod` instead of `MethodDefinition`;
- `ClassPrivateMethod`
- `ClassPrivateMethod`;
- `ClassPrivateName` stores name as `Identifier` in `id` field;

@@ -37,0 +38,0 @@ - `ClassPrivateProperty` instead of `FieldDefinition`;

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