"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "js/src/cli.js" between
js-beautify-1.13.13.tar.gz and js-beautify-1.14.0.tar.gz

About: JS Beautifier is a JavaScript (and bookmarket) beautifier.

cli.js  (js-beautify-1.13.13):cli.js  (js-beautify-1.14.0)
skipping to change at line 43 skipping to change at line 43
*/ */
/*jshint strict:false */ /*jshint strict:false */
var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG ? funct ion() { var debug = process.env.DEBUG_JSBEAUTIFY || process.env.JSBEAUTIFY_DEBUG ? funct ion() {
console.error.apply(console, arguments); console.error.apply(console, arguments);
} : function() {}; } : function() {};
var fs = require('fs'), var fs = require('fs'),
cc = require('config-chain'), cc = require('config-chain'),
beautify = require('../index'), beautify = require('../index'),
mkdirp = require('mkdirp'),
nopt = require('nopt'), nopt = require('nopt'),
glob = require('glob'); glob = require('glob');
nopt.invalidHandler = function(key, val) { nopt.invalidHandler = function(key, val) {
throw new Error(key + " was invalid with value \"" + val + "\""); throw new Error(key + " was invalid with value \"" + val + "\"");
}; };
nopt.typeDefs.brace_style = { nopt.typeDefs.brace_style = {
type: "brace_style", type: "brace_style",
validate: function(data, key, val) { validate: function(data, key, val) {
skipping to change at line 487 skipping to change at line 486
} }
function writePretty(err, pretty, outfile, config) { function writePretty(err, pretty, outfile, config) {
debug('writing ' + outfile); debug('writing ' + outfile);
if (err) { if (err) {
console.error(err); console.error(err);
process.exit(1); process.exit(1);
} }
if (outfile) { if (outfile) {
mkdirp.sync(path.dirname(outfile)); fs.mkdirSync(path.dirname(outfile), { recursive: true });
if (isFileDifferent(outfile, pretty)) { if (isFileDifferent(outfile, pretty)) {
try { try {
fs.writeFileSync(outfile, pretty, 'utf8'); fs.writeFileSync(outfile, pretty, 'utf8');
logToStdout('beautified ' + path.relative(process.cwd(), outfile ), config); logToStdout('beautified ' + path.relative(process.cwd(), outfile ), config);
} catch (ex) { } catch (ex) {
onOutputError(ex); onOutputError(ex);
} }
} else { } else {
logToStdout('beautified ' + path.relative(process.cwd(), outfile) + ' - unchanged', config); logToStdout('beautified ' + path.relative(process.cwd(), outfile) + ' - unchanged', config);
 End of changes. 2 change blocks. 
2 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)