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

@putout/printer

Package Overview
Dependencies
Maintainers
0
Versions
592
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 10.4.1 to 10.5.0

3

lib/tokenize/expressions/object-pattern/more-then-max-properties-length-in-one-line.js
'use strict';
const {types} = require('@putout/babel');
const {
isAssignmentPattern,
isIdentifier,
} = require('@putout/babel').types;
} = types;

@@ -8,0 +9,0 @@ module.exports.moreThenMaxPropertiesLengthInOneLine = (path, {maxPropertiesLengthInOneLine}) => {

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

isAssignmentPattern,
isVariableDeclarator,
} = require('@putout/babel').types;

@@ -24,5 +25,2 @@

const isTwoLevelsDeep = ({parentPath}) => parentPath.parentPath.parentPath.isObjectProperty();
const isOneParentProperty = ({parentPath}) => parentPath.parentPath.node.properties?.length === 1;
function isIndent(path) {

@@ -39,2 +37,5 @@ return !path.parentPath.isArrayPattern();

if (path.parentPath.isVariableDeclarator() && !hasAssign(path.get('properties')))
return false;
return !path.parentPath.isObjectProperty();

@@ -109,3 +110,3 @@ };

if (is || hasObject && !isAssign) {
if (is || hasObject) {
print(',');

@@ -128,14 +129,2 @@ print.newline();

}),
afterIf(path) {
if (!path.parentPath.isObjectProperty())
return false;
if (isTwoLevelsDeep(path))
return false;
return isOneParentProperty(path);
},
after(path, {print}) {
print.newline();
},
};

@@ -200,3 +189,6 @@

if (moreCount && !moreLength)
if (hasObjectPattern(properties))
return COUPLE_LINES;
if (moreCount && !moreLength && isVariableDeclarator(path.parentPath))
return ONE_LINE;

@@ -203,0 +195,0 @@

{
"name": "@putout/printer",
"version": "10.4.1",
"version": "10.5.0",
"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