@putout/printer
Advanced tools
| import {types} from '@putout/babel'; | ||
| const {isBlockStatement} = types; | ||
| export const printTrailingCommentBlock = (path, printer, semantics, {printComment}) => { | ||
| const {print} = printer; | ||
| print.breakline(); | ||
| printComment(); | ||
| }; | ||
| export const printTrailingCommentLine = (path, printer, semantics, {printComment}) => { | ||
| const {consequent} = path.node; | ||
| const consequentIsBlock = isBlockStatement(consequent); | ||
| const {print, maybe} = printer; | ||
| print.indent(); | ||
| maybe.print.space(!consequentIsBlock); | ||
| printComment(); | ||
| maybe.print.newline(consequentIsBlock); | ||
| }; |
@@ -314,2 +314,1 @@ import {fullstore} from 'fullstore'; | ||
| }; | ||
@@ -8,2 +8,6 @@ import {types} from '@putout/babel'; | ||
| import {markAfter} from '../../mark.js'; | ||
| import { | ||
| printTrailingCommentBlock, | ||
| printTrailingCommentLine, | ||
| } from './if-statement-comments.js'; | ||
@@ -60,2 +64,4 @@ const { | ||
| export const IfStatement = { | ||
| printTrailingCommentBlock, | ||
| printTrailingCommentLine, | ||
| print: (path, {indent, print, maybe, write, traverse}) => { | ||
@@ -62,0 +68,0 @@ const {parentPath} = path; |
+1
-1
| { | ||
| "name": "@putout/printer", | ||
| "version": "17.9.0", | ||
| "version": "17.10.0", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
299663
0.31%177
0.57%6306
0.35%