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

putout

Package Overview
Dependencies
Maintainers
1
Versions
1214
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

putout - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

29

lib/get-vars.js

@@ -24,2 +24,3 @@ 'use strict';

isObjectPattern,
isTemplateLiteral,
} = require('@babel/types');

@@ -47,8 +48,9 @@

const {node} = path;
const {init} = node;
if (isObjectPattern(node.id)) {
if (isIdentifier(node.init))
use(path, node.init.name);
if (isIdentifier(init))
use(path, init.name);
path.traverse({
path.get('id').traverse({
ObjectProperty(propPath) {

@@ -69,4 +71,4 @@ if (!isIdentifier(propPath.node.value))

if (isObjectExpression(node.init)) {
for (const property of node.init.properties) {
if (isObjectExpression(init)) {
for (const property of init.properties) {
if (isSpreadElement(property))

@@ -77,5 +79,11 @@ use(path, property.argument.name);

}
} else if (isTemplateLiteral(init)) {
path.get('init').traverse({
Identifier(path) {
use(path, path.node.name);
}
});
}
declare(path, path.node.id.name);
declare(path, node.id.name);
},

@@ -145,2 +153,11 @@

path.traverse({
TemplateLiteral(path) {
const {node} = path;
const {expressions} = node;
for (const exp of expressions) {
if (isIdentifier(exp))
use(path, exp.name);
}
},
Identifier(path) {

@@ -147,0 +164,0 @@ if (node.arguments.includes(path.node))

{
"name": "putout",
"version": "2.2.0",
"version": "2.3.0",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

@@ -5,0 +5,0 @@ "description": "find and remove unused variables",

Sorry, the diff of this file is not supported yet

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