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
0
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 13.0.0 to 13.1.0

lib/parens.js

4

lib/operate.js

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

const {getPathAfterRequires} = require('./get-path-after-requires');
const {addParens, removeParens} = require('./parens');

@@ -52,2 +53,5 @@ const {

module.exports.addParens = addParens;
module.exports.removeParens = removeParens;
module.exports.getProperty = getProperty;

@@ -54,0 +58,0 @@ module.exports.getProperties = getProperties;

8

lib/properties/traverse-properties.js

@@ -6,6 +6,3 @@ 'use strict';

const {
isObjectExpression,
isCallExpression,
} = types;
const {isObjectExpression} = types;

@@ -18,5 +15,2 @@ const nodeOrPath = (path) => path.node || path;

if (isCallExpression(path.parentPath))
return path.parentPath.node;
return {

@@ -23,0 +17,0 @@ type: 'ExpressionStatement',

@@ -6,13 +6,4 @@ 'use strict';

const parseNode = (a) => {
a = extractMark(a);
if (a.node)
return a.node;
return a;
};
module.exports.replaceWith = (path, node) => {
node = parseNode(node);
node = extractMark(node);

@@ -19,0 +10,0 @@ if (path?.parentPath?.isExpressionStatement() && !path.parentPath.isProgram()) {

{
"name": "@putout/operate",
"version": "13.0.0",
"version": "13.1.0",
"type": "commonjs",

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

@@ -257,4 +257,26 @@ # Operate [![NPM version][NPMIMGURL]][NPMURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]

### `addParens(path: Path)`
Add parens around expression depending on used `printer`:
- ✅ set `node.extra.parenthesized: true` when `@putout/printer` used;
- ✅ set add `ParenthesizedExpression` or `TSParenthesizedType` when `babel` used;
```js
addParens(path);
```
### `removeParens(path: Path)`
Remove parens around expression depending on used `printer`:
- ✅ set `node.extra.parenthesized: false` when `@putout/printer` used;
- ✅ remove `ParenthesizedExpression` or `TSParenthesizedType` when `babel` used;
```js
removeParens(path);
```
## License
MIT
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