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

@putout/operate

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/operate - npm Package Compare versions

Comparing version 8.6.1 to 8.7.0

27

lib/operate.js

@@ -10,2 +10,4 @@ 'use strict';

isExpression,
isStatement,
BlockStatement,
} = require('@babel/types');

@@ -52,6 +54,7 @@

const {comments, loc} = path.node;
const {currentPath} = maybeBody(path, node);
path.replaceWith(node);
currentPath.replaceWith(node);
assign(path.node, {
assign(currentPath.node, {
comments,

@@ -61,3 +64,3 @@ loc,

return path;
return currentPath;
}

@@ -73,3 +76,4 @@

const newPath = path.replaceWithMultiple(newNodes);
const {currentPath} = maybeBody(path);
const newPath = currentPath.replaceWithMultiple(newNodes);

@@ -165,1 +169,16 @@ if (!newPath.length)

function maybeBody(path, node) {
const {parentPath} = path;
if (node && !isStatement(node) || !parentPath?.isArrowFunctionExpression?.())
return {
currentPath: path,
};
parentPath.node.body = BlockStatement([ExpressionStatement(path.node)]);
return {
currentPath: parentPath.get('body.body.0'),
};
}

2

package.json
{
"name": "@putout/operate",
"version": "8.6.1",
"version": "8.7.0",
"type": "commonjs",

@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

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