@putout/printer
Advanced tools
Comparing version 11.9.0 to 11.10.0
@@ -92,3 +92,7 @@ 'use strict'; | ||
const propIs = isProperty(path); | ||
const isIndent = isFirst(path) || !looksLikeSwitchCase && !path.isClassMethod() && !insideFn && !propIs; | ||
const isIndent = isFirst(path) | ||
|| !looksLikeSwitchCase | ||
&& !path.isClassMethod() | ||
&& !insideFn | ||
&& !propIs; | ||
@@ -95,0 +99,0 @@ for (const {type, value} of leadingComments) { |
@@ -38,3 +38,3 @@ 'use strict'; | ||
module.exports.ExportNamedDeclaration = { | ||
print(path, {print, traverse, write, indent, maybe}) { | ||
print(path, {print, traverse, indent, maybe}) { | ||
const {exportKind} = path.node; | ||
@@ -46,3 +46,3 @@ const specifiers = path.get('specifiers'); | ||
indent(); | ||
write('export'); | ||
print('export'); | ||
@@ -66,35 +66,39 @@ if (exportKind === 'type' && specifiers.length) | ||
if (specifiers.length) { | ||
if (specifiers && !path.node.declaration) { | ||
print.space(); | ||
write('{'); | ||
indent.inc(); | ||
maybe.write.newline(isNewline); | ||
print('{'); | ||
const lastIndex = n - 1; | ||
for (const [i, spec] of specifiers.entries()) { | ||
const isType = spec.node.exportKind === 'type'; | ||
maybe.indent(isNewline); | ||
maybe.write(isType, 'type '); | ||
traverse(spec); | ||
if (specifiers.length) { | ||
indent.inc(); | ||
maybe.print.newline(isNewline); | ||
if (i < lastIndex && !isNewline) | ||
write(', '); | ||
const lastIndex = n - 1; | ||
maybe.write(isNewline, ','); | ||
maybe.write.newline(isNewline); | ||
for (const [i, spec] of specifiers.entries()) { | ||
const isType = spec.node.exportKind === 'type'; | ||
maybe.indent(isNewline); | ||
maybe.print(isType, 'type '); | ||
traverse(spec); | ||
if (i < lastIndex && !isNewline) | ||
print(', '); | ||
maybe.print(isNewline, ','); | ||
maybe.print.newline(isNewline); | ||
} | ||
indent.dec(); | ||
indent(); | ||
} | ||
indent.dec(); | ||
indent(); | ||
write('}'); | ||
print('}'); | ||
const source = path.get('source'); | ||
if (exists(source)) { | ||
write(' from '); | ||
print(' from '); | ||
traverse(source); | ||
} | ||
write(';'); | ||
maybe.write.newline(isNext(path) || isInsideNamespace(path)); | ||
print(';'); | ||
maybe.print.newline(isNext(path) || isInsideNamespace(path)); | ||
@@ -121,1 +125,2 @@ return; | ||
}; | ||
{ | ||
"name": "@putout/printer", | ||
"version": "11.9.0", | ||
"version": "11.10.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
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
243453
5310