js-beautify
Advanced tools
Comparing version 0.3.6 to 0.3.7
10
cli.js
@@ -208,3 +208,4 @@ #!/usr/bin/env node | ||
try { | ||
var pretty = beautify[config.type](code, config); | ||
var fileType = getOutputType(outfile, config.type); | ||
var pretty = beautify[fileType](code, config); | ||
@@ -280,2 +281,9 @@ // ensure newline at end of beautified output | ||
function getOutputType(outfile, configType) { | ||
if (outfile && /\.(js|css|html)$/.test(outfile)) { | ||
return outfile.split('.').pop(); | ||
} | ||
return configType; | ||
} | ||
function getScriptName() { | ||
@@ -282,0 +290,0 @@ return path.basename(process.argv[1]); |
{ | ||
"name": "js-beautify", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "jsbeautifier.org for node", | ||
@@ -5,0 +5,0 @@ "main": "beautify.js", |
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
114623
2342