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 1.3.0 to 1.4.0

lib/set-class-method.js

43

lib/estree-to-babel.js

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

isObjectExpression,
isLiteral,
classMethod,
isLiteral
} = require('@babel/types');
const traverseObjectExpression = require('./traverse-object-expression');
const setClassMethod = require('./set-class-method');
const isString = (a) => typeof a === 'string';
const isNumber = (a) => typeof a === 'number';
const isNull = (a) => a === null;
const {assign} = Object;
module.exports = (node) => {

@@ -53,33 +52,2 @@ const {

function setClassMethod(path) {
const {node} = path;
const {
key,
kind,
computed,
} = node;
const {
body,
params,
expression,
generator,
} = node.value;
path.replaceWith(classMethod(
kind,
key,
params,
body,
computed,
node.static,
)
);
assign(path.node, {
expression,
generator,
});
}
function setObjectProperty(node) {

@@ -101,3 +69,8 @@ node.type = 'ObjectProperty';

}
if (isNull(value)) {
node.type = 'NullLiteral';
return;
}
}
{
"name": "estree-to-babel",
"version": "1.3.0",
"version": "1.4.0",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

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

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

- `File` node;
- `StringLiteral`, `NumericLiteral` instead of `Literal`;
- `StringLiteral`, `NumericLiteral`, `NullLiteral` instead of `Literal`;
- `ClassMethod` instead of `MethodDefinition`;

@@ -33,0 +33,0 @@ - etc...

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