@putout/printer
Advanced tools
Comparing version 1.14.1 to 1.14.2
'use strict'; | ||
module.exports.ClassDeclaration = (path, {maybe, print, indent}) => { | ||
module.exports.ClassDeclaration = (path, {print, indent}) => { | ||
indent(); | ||
@@ -20,8 +20,6 @@ print('class '); | ||
const body = path.get('body.body'); | ||
const n = body.length - 1; | ||
for (const [i, item] of body.entries()) { | ||
for (const item of body) { | ||
indent(); | ||
print(item); | ||
maybe.print(i < n, '\n'); | ||
} | ||
@@ -28,0 +26,0 @@ |
@@ -102,2 +102,7 @@ 'use strict'; | ||
module.exports.ClassMethod = (path, {print}) => { | ||
const {kind} = path.node; | ||
if (kind !== 'method') | ||
print(`${kind} `); | ||
print('__key'); | ||
@@ -104,0 +109,0 @@ print('('); |
@@ -5,4 +5,13 @@ 'use strict'; | ||
const isParentBlock = (path) => path.parentPath.isBlockStatement(); | ||
const isNext = (path) => path.getNextSibling().node; | ||
const isNextParent = (path) => path.parentPath.getNextSibling().node; | ||
const isNext = (path) => { | ||
const next = path.getNextSibling(); | ||
if (!next.node) | ||
return false; | ||
return !next.isEmptyStatement(); | ||
}; | ||
const isNextParent = (path) => isNext(path.parentPath); | ||
const isLast = (path) => isParentProgram(path) && !isNext(path); | ||
@@ -9,0 +18,0 @@ |
@@ -38,2 +38,3 @@ 'use strict'; | ||
}, | ||
EmptyStatement({}) {}, | ||
InterpreterDirective(path, {print}) { | ||
@@ -40,0 +41,0 @@ print(`#!${path.node.value}`); |
{ | ||
"name": "@putout/printer", | ||
"version": "1.14.1", | ||
"version": "1.14.2", | ||
"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
57179
1645