Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-debug-tools

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-debug-tools - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

39

lib/index.js

@@ -113,20 +113,39 @@ "use strict";

const cname = t.stringLiteral((0, _generator.default)(cclone).code);
const aexpr = t.arrayExpression([cname, cclone]);
prev.push(aexpr);
if (t.isBinaryExpression(cclone)) {
const leftId = path.scope.generateUidIdentifier('left');
const cnameleft = t.stringLiteral((0, _generator.default)(cclone.left).code);
const cnameright = t.stringLiteral((0, _generator.default)(cclone.right).code);
const isLiteralleft = t.isLiteral(cclone.left);
const isLiteralright = t.isLiteral(cclone.right);
path.scope.push({
id: leftId
});
const rightId = path.scope.generateUidIdentifier('right');
path.scope.push({
id: rightId
});
path.insertBefore(t.expressionStatement(t.assignmentExpression('=', leftId, t.clone(cclone.left))));
path.insertBefore(t.expressionStatement(t.assignmentExpression('=', rightId, t.clone(cclone.right))));
cclone.left = leftId;
cclone.right = rightId;
const aexpr = t.arrayExpression([cname, cclone]);
prev.push(aexpr);
const binExpr = t.objectExpression([]);
const left = t.clone(cclone.left);
const cnameleft = t.stringLiteral((0, _generator.default)(left).code);
if (!t.isLiteral(left)) binExpr.properties.push(t.objectProperty(cnameleft, left));
if (!isLiteralleft) binExpr.properties.push(t.objectProperty(cnameleft, left));
const right = t.clone(cclone.right);
const cnameright = t.stringLiteral((0, _generator.default)(right).code);
if (!t.isLiteral(right)) binExpr.properties.push(t.objectProperty(cnameright, right));
if (!isLiteralright) binExpr.properties.push(t.objectProperty(cnameright, right));
aexpr.elements.push(binExpr);
} else if (t.isUnaryExpression(cclone)) {
const arg = t.clone(cclone.argument);
const argId = path.scope.generateUidIdentifier('arg');
const cnameArg = t.stringLiteral((0, _generator.default)(cclone.argument).code);
const isLiteralArg = t.isLiteral(cclone.argument);
path.insertBefore(t.expressionStatement(t.assignmentExpression('=', argId, t.clone(cclone.argument))));
cclone.argument = argId;
const aexpr = t.arrayExpression([cname, cclone]);
prev.push(aexpr);
if (!t.isLiteral(arg)) {
const cnamearg = t.stringLiteral((0, _generator.default)(arg).code);
aexpr.elements.push(t.objectExpression([t.objectProperty(cnamearg, arg)]));
if (!isLiteralArg) {
aexpr.elements.push(t.objectExpression([t.objectProperty(cnameArg, argId)]));
}

@@ -133,0 +152,0 @@ } else throw path.buildCodeFrameError("unsupported expression");

{
"name": "babel-plugin-debug-tools",
"version": "1.0.16",
"version": "1.0.17",
"description": "Helpers for debug Javascript Applications",

@@ -19,2 +19,3 @@ "repository": {

"test": "jest",
"dev": "jest --watchAll",
"ci": "jest",

@@ -21,0 +22,0 @@ "syntax-check": "npx tsc -p ./tsconfig.json"

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