You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

babel-plugin-encours

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-encours - npm Package Compare versions

Comparing version
0.0.5
to
0.0.6
+1
-1
package.json
{
"name": "babel-plugin-encours",
"version": "0.0.5",
"version": "0.0.6",
"description": "A small plugin to transpile jsx for the encours framework",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -9,11 +9,7 @@ module.exports = function (babel) {

var stringChild = t.stringLiteral(path.node.value);
//console.log(path.scope);
path.replaceWith(stringChild, path.node);
},
JSXElement(path) {
//get the opening element from jsxElement node
var openingElement = path.node.openingElement;
//tagname is name of tag like div, p etc
var tagName = openingElement.name.name;
// arguments for React.createElement function
var args = [];

@@ -55,3 +51,2 @@ //adds "div" or any tag as a string as one of the argument

const child = children[i];
console.log("node", children[i]);
if (child.type === "JSXElement") {

@@ -68,5 +63,2 @@ childArray.push(child);

callExpression.arguments = callExpression.arguments.concat(childArray);
//callExpression.arguments = callExpression.arguments.concat(path.node.children);
// replace jsxElement node with the call expression node made above
path.replaceWith(callExpression, path.node);

@@ -73,0 +65,0 @@ },