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

@putout/printer

Package Overview
Dependencies
Maintainers
1
Versions
604
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/printer - npm Package Compare versions

Comparing version 1.49.0 to 1.49.1

23

lib/tokenize/expressions/object-expression.js
'use strict';
const {isCoupleLines} = require('../is');
const {
isFunction,
isIfStatement,
isStatement,
} = require('@babel/types');
isCoupleLines,
isForOf,
isIf,
} = require('../is');
const {isFunction} = require('@babel/types');
const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
const isLogical = (path) => path.get('argument').isLogicalExpression();
const isValue = (path) => path.get('properties.0.value').node;
const isIfOrStatement = (a) => isIfStatement(a) || isStatement(a);
const isIf = (path) => isIfStatement(path.find(
isIfOrStatement,
));
const isParentExpression = (path) => path.parentPath.isExpressionStatement();
const isForOf = (path) => {
if (path.parentPath.isForOfStatement())
return true;
return path.parentPath?.parentPath?.isForOfStatement();
};
module.exports.ObjectExpression = (path, {print, maybe, indent}) => {

@@ -28,0 +17,0 @@ indent.inc();

'use strict';
const {isIdentifier} = require('@babel/types');
const isForOf = (path) => path.parentPath?.parentPath?.parentPath?.isForOfStatement();
const {isForOf} = require('../is');

@@ -6,0 +6,0 @@ module.exports.ObjectPattern = (path, {indent, print, maybe}) => {

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

isIdentifier,
isIfStatement,
isStatement,
isForOfStatement,
isVariableDeclaration,
} = require('@babel/types');

@@ -52,1 +56,20 @@

module.exports.isStringAndIdentifier = ([a, b]) => isStringLiteral(a) && isIdentifier(b);
const isIfOrStatement = (a) => isIfStatement(a) || isStatement(a);
const isForOfOrStatement = (a) => isForOfStatement(a) || isStatement(a);
module.exports.isIf = (path) => isIfStatement(path.find(
isIfOrStatement,
));
module.exports.isForOf = (path) => {
const current = path.find(isForOfOrStatement);
if (isForOfStatement(current))
return true;
if (isVariableDeclaration(current))
return isForOfStatement(current.parentPath);
return false;
};
{
"name": "@putout/printer",
"version": "1.49.0",
"version": "1.49.1",
"type": "commonjs",

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

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