@putout/printer
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -14,3 +14,3 @@ 'use strict'; | ||
if (shouldAddNewLine(path) && !isMarkedParentBefore(path) && !isMarkedPrevAfter(path.parentPath)) | ||
print.linebreak(); | ||
print.breakline(); | ||
@@ -17,0 +17,0 @@ print(path.get('callee')); |
@@ -9,3 +9,3 @@ 'use strict'; | ||
if (!isFirst(path)) { | ||
print.linebreak(); | ||
print.breakline(); | ||
} | ||
@@ -12,0 +12,0 @@ |
@@ -10,5 +10,5 @@ 'use strict'; | ||
module.exports.ExpressionStatement = (path, {write, indent, traverse}) => { | ||
module.exports.ExpressionStatement = (path, {write, indent, traverse, print}) => { | ||
if (isCoupleLinesExpression(path) && !isFirst(path) && shouldAddNewLine(path) && !isMarkedPrevAfter(path)) { | ||
write.linebreak(); | ||
print.breakline(); | ||
markBefore(path); | ||
@@ -66,1 +66,2 @@ } | ||
} | ||
@@ -19,3 +19,3 @@ 'use strict'; | ||
maybe.print.linebreak(isNext(path)); | ||
maybe.print.breakline(isNext(path)); | ||
}; | ||
@@ -22,0 +22,0 @@ |
@@ -16,3 +16,3 @@ 'use strict'; | ||
if (!isFirst(path) && shouldAddNewLine(path) && !hasPrevNewline(path)) | ||
print.linebreak(); | ||
print.breakline(); | ||
@@ -35,4 +35,3 @@ const isParentBlock = /Program|BlockStatement/.test(path.parentPath.type); | ||
if (is) { | ||
print.indent(); | ||
print.newline(); | ||
print.linebreak(); | ||
markAfter(path); | ||
@@ -39,0 +38,0 @@ } |
@@ -40,3 +40,3 @@ 'use strict'; | ||
const maybeNewline = (a) => a && newline(); | ||
const maybeLinebreak = (a) => a && linebreak(); | ||
const maybeBreakline = (a) => a && breakline(); | ||
@@ -61,2 +61,9 @@ let i = 0; | ||
type: TYPES.NEWLINE, | ||
value: `${printIndent(i)}\n`, | ||
}); | ||
}; | ||
const breakline = () => { | ||
tokens.push({ | ||
type: TYPES.NEWLINE, | ||
value: `\n${printIndent(i)}`, | ||
@@ -77,2 +84,3 @@ }); | ||
linebreak, | ||
breakline, | ||
}); | ||
@@ -104,3 +112,3 @@ const print = (maybeLine) => { | ||
newline: maybeNewline, | ||
linebreak: maybeLinebreak, | ||
breakline: maybeBreakline, | ||
}); | ||
@@ -107,0 +115,0 @@ |
{ | ||
"name": "@putout/printer", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36407
1033