@putout/printer
Advanced tools
Comparing version 1.53.0 to 1.54.0
'use strict'; | ||
module.exports.AssignmentExpression = (path, {print}) => { | ||
const {operator} = path.node; | ||
print('__left'); | ||
print(' '); | ||
print(operator); | ||
print(' '); | ||
print('__right'); | ||
const {isObjectPattern} = require('@babel/types'); | ||
module.exports.AssignmentExpression = { | ||
condition: (path) => isObjectPattern(path.node.left), | ||
before(path, {write}) { | ||
write('('); | ||
}, | ||
print(path, {print}) { | ||
const {operator} = path.node; | ||
print('__left'); | ||
print(' '); | ||
print(operator); | ||
print(' '); | ||
print('__right'); | ||
}, | ||
after(path, {write}) { | ||
write(')'); | ||
}, | ||
}; | ||
@@ -42,2 +42,5 @@ 'use strict'; | ||
}, | ||
Import(path, {write}) { | ||
write('import'); | ||
}, | ||
}; |
@@ -60,3 +60,6 @@ 'use strict'; | ||
function noNextParentBlock(path) { | ||
return !isNext(path) && path.parentPath.isBlockStatement(); | ||
if (isNext(path)) | ||
return false; | ||
return path.parentPath.isBlockStatement(); | ||
} | ||
@@ -72,3 +75,6 @@ | ||
function notLastCoupleLines(path) { | ||
return !isLast(path) && isCoupleLines(path); | ||
if (isLast(path)) | ||
return false; | ||
return isCoupleLines(path); | ||
} | ||
@@ -88,3 +94,2 @@ | ||
} | ||
const isLast = (path) => path.parentPath?.isProgram() && !isNext(path); | ||
@@ -91,0 +96,0 @@ |
{ | ||
"name": "@putout/printer", | ||
"version": "1.53.0", | ||
"version": "1.54.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
87243
2347