@putout/operate
Advanced tools
Comparing version 12.18.0 to 13.0.0
@@ -9,4 +9,5 @@ 'use strict'; | ||
const prev = getPrevSibling(path); | ||
const next = getNextSibling(path); | ||
if (scope) { | ||
if (scope && !next.node) { | ||
const programBlock = scope.getProgramParent().block; | ||
@@ -41,6 +42,6 @@ | ||
const getComments = (path) => { | ||
const {comments} = path.node; | ||
const {leadingComments} = path.node; | ||
if (comments?.length) | ||
return comments; | ||
if (leadingComments?.length) | ||
return leadingComments; | ||
@@ -50,3 +51,3 @@ const {parentPath} = path; | ||
if (path.isVariableDeclarator() && isOneDeclaration(parentPath)) | ||
return parentPath.node.comments; | ||
return parentPath.node.leadingComments; | ||
@@ -62,1 +63,8 @@ return []; | ||
}; | ||
const getNextSibling = (path) => { | ||
if (!path.isVariableDeclarator()) | ||
return path.getNextSibling(); | ||
return path.parentPath.getNextSibling(); | ||
}; |
{ | ||
"name": "@putout/operate", | ||
"version": "12.18.0", | ||
"version": "13.0.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
28860
667