@putout/printer
Advanced tools
Comparing version 1.8.11 to 1.9.0
@@ -5,3 +5,7 @@ 'use strict'; | ||
const toSnakeCase = require('just-snake-case'); | ||
const {LOG, DEBUG} = process.env; | ||
const { | ||
LOG, | ||
LOG_ALL, | ||
DEBUG, | ||
} = process.env; | ||
const {codeFrameColumns} = require('@babel/code-frame'); | ||
@@ -20,7 +24,4 @@ | ||
module.exports.createLog = ({newline = '\n', store = createStore()} = {}) => (chunk) => { | ||
if (!LOG) | ||
return; | ||
if (chunk === newline) { | ||
console.log(codeFrameColumns(store(), {}, { | ||
if (LOG_ALL) { | ||
console.log(codeFrameColumns(chunk, {}, { | ||
highlightCode: true, | ||
@@ -31,3 +32,12 @@ })); | ||
store(chunk); | ||
if (LOG) { | ||
if (chunk === newline) { | ||
console.log(codeFrameColumns(store(), {}, { | ||
highlightCode: true, | ||
})); | ||
return; | ||
} | ||
store(chunk); | ||
} | ||
}; | ||
@@ -34,0 +44,0 @@ |
@@ -16,3 +16,3 @@ 'use strict'; | ||
if (spec.isImportSpecifier()) { | ||
maybe.print(index, ', '); | ||
maybe.print(Number(index), ', '); | ||
print('{'); | ||
@@ -19,0 +19,0 @@ print(spec.get('imported')); |
@@ -17,2 +17,3 @@ 'use strict'; | ||
const {ForInStatement} = require('./for-in-statement'); | ||
const {ExportDefaultDeclaration} = require('./export-default-declaration'); | ||
@@ -24,2 +25,3 @@ module.exports = { | ||
ExpressionStatement, | ||
ExportDefaultDeclaration, | ||
VariableDeclaration, | ||
@@ -26,0 +28,0 @@ IfStatement, |
{ | ||
"name": "@putout/printer", | ||
"version": "1.8.11", | ||
"version": "1.9.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
49927
51
1413