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 6.1.4 to 6.2.0

12

lib/operate.js

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

isImportDeclaration,
isLiteral,
isIdentifier,
} = require('@babel/types');

@@ -136,1 +138,11 @@

module.exports.extract = (node) => {
if (isIdentifier(node))
return node.name;
if (isLiteral(node))
return node.value;
throw Error('"operator.extract(node)" understands only Literals and Identifiers 🤷');
};

2

package.json
{
"name": "@putout/operate",
"version": "6.1.4",
"version": "6.2.0",
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

@@ -5,0 +5,0 @@ "description": "operate on ast",

@@ -24,2 +24,9 @@ # Operate [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]

### extract(path)
- checks the node by type,
- if it is `Identifier` return `name`,
- if it is any type of `Literal` return `value`
- `throw` in other cases
### replaceWith(path, node)

@@ -26,0 +33,0 @@

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