New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-vdux-transform

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-vdux-transform - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

42

lib/index.js

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

function isVduxLikeComponent(node) {
return t.isCallExpression(node) && node.callee.name === 'component' && isVduxLikeComponentObject(node.arguments[0]);
}
function isHocComponent(node, hoc) {

@@ -116,3 +120,3 @@ if (t.isCallExpression(node)) {

CallExpression: function CallExpression(path) {
if (path.node[VISITED_KEY] || !isHocComponent(path.node, this.options.hoc)) {
if (path.node[VISITED_KEY] || !isHocComponent(path.node, this.options.hoc) && !isVduxLikeComponent(path.node)) {
return;

@@ -134,23 +138,25 @@ }

path.replaceWith(wrapComponent(path.node, componentId, this.wrapperFunctionId));
},
ObjectExpression: function ObjectExpression(path) {
if (path.node[VISITED_KEY] || !isVduxLikeComponentObject(path.node)) {
return;
}
}
path.node[VISITED_KEY] = true;
// ObjectExpression (path) {
// if (path.node[VISITED_KEY] || !isVduxLikeComponentObject(path.node)) {
// return
// }
// `foo({ displayName: 'NAME' })` => 'NAME'
var componentName = getDisplayName(path.node);
var componentId = componentName || path.scope.generateUid('component');
var isInFunction = hasParentFunction(path);
// path.node[VISITED_KEY] = true
this.components.push({
id: componentId,
name: componentName,
isInFunction: isInFunction
});
// // `foo({ displayName: 'NAME' })` => 'NAME'
// const componentName = getDisplayName(path.node)
// const componentId = componentName || path.scope.generateUid('component')
// const isInFunction = hasParentFunction(path)
path.replaceWith(wrapComponent(path.node, componentId, this.wrapperFunctionId));
}
// this.components.push({
// id: componentId,
// name: componentName,
// isInFunction: isInFunction
// })
// path.replaceWith(wrapComponent(path.node, componentId, this.wrapperFunctionId))
// }
};

@@ -157,0 +163,0 @@

{
"name": "babel-plugin-vdux-transform",
"version": "1.0.5",
"version": "1.1.0",
"description": "Babel plugin to instrument vdux components with custom transforms",

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

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