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

babel-plugin-idx

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-idx - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

22

lib/babel-plugin-idx.js

@@ -49,2 +49,10 @@ /**

}, {
key: 'appendMethodCall',
value: function appendMethodCall(args) {
var uid = this.generateUid('ref').name;
var callExpression = t.CallExpression(t.Identifier(uid), args || []);
this.addLevel(callExpression, uid);
this.uids.push(uid);
}
}, {
key: 'appendPropertyAccess',

@@ -83,3 +91,5 @@ value: function appendPropertyAccess(property, computed) {

function getExpressionChainBase(node) {
if (t.isMemberExpression(node)) {
if (t.isCallExpression(node)) {
return getExpressionChainBase(node.callee);
} else if (t.isMemberExpression(node)) {
return getExpressionChainBase(node.object);

@@ -96,6 +106,10 @@ } else {

function constructTernary(base, node, generateUid) {
if (t.isMemberExpression(node)) {
var transformedObject = constructTernary(base, node.object, generateUid);
transformedObject.appendPropertyAccess(node.property, node.computed);
if (t.isCallExpression(node)) {
var transformedObject = constructTernary(base, node.callee, generateUid);
transformedObject.appendMethodCall(node.arguments);
return transformedObject;
} else if (t.isMemberExpression(node)) {
var _transformedObject = constructTernary(base, node.object, generateUid);
_transformedObject.appendPropertyAccess(node.property, node.computed);
return _transformedObject;
} else {

@@ -102,0 +116,0 @@ return new TransformedTernary(base, generateUid);

2

package.json
{
"name": "babel-plugin-idx",
"version": "1.0.1",
"version": "1.1.0",
"description": "Babel plugin for transforming the idx utility function.",

@@ -5,0 +5,0 @@ "main": "lib/babel-plugin-idx.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