From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/gulp-debug/index.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'node_modules/gulp-debug/index.js') diff --git a/node_modules/gulp-debug/index.js b/node_modules/gulp-debug/index.js index ce720ab38..1a6c70fe0 100644 --- a/node_modules/gulp-debug/index.js +++ b/node_modules/gulp-debug/index.js @@ -1,6 +1,6 @@ 'use strict'; const path = require('path'); -const gutil = require('gulp-util'); +const fancyLog = require('fancy-log'); const through = require('through2'); const tildify = require('tildify'); const stringifyObject = require('stringify-object'); @@ -9,40 +9,43 @@ const plur = require('plur'); const prop = chalk.blue; -module.exports = opts => { - opts = Object.assign({ +module.exports = options => { + options = Object.assign({ title: 'gulp-debug:', minimal: true, showFiles: true - }, opts); + }, options); if (process.argv.indexOf('--verbose') !== -1) { - opts.verbose = true; - opts.minimal = false; - opts.showFiles = true; + options.verbose = true; + options.minimal = false; + options.showFiles = true; } let count = 0; return through.obj((file, enc, cb) => { - if (opts.showFiles) { + if (options.showFiles) { const full = '\n' + (file.cwd ? 'cwd: ' + prop(tildify(file.cwd)) : '') + (file.base ? '\nbase: ' + prop(tildify(file.base)) : '') + (file.path ? '\npath: ' + prop(tildify(file.path)) : '') + - (file.stat && opts.verbose ? '\nstat: ' + prop(stringifyObject(file.stat, {indent: ' '}).replace(/[{}]/g, '').trim()) : '') + + (file.stat && options.verbose ? '\nstat: ' + prop(stringifyObject(file.stat, {indent: ' '}).replace(/[{}]/g, '').trim()) : '') + '\n'; - const output = opts.minimal ? prop(path.relative(process.cwd(), file.path)) : full; + const output = options.minimal ? prop(path.relative(process.cwd(), file.path)) : full; - gutil.log(opts.title + ' ' + output); + module.exports._log(options.title + ' ' + output); } count++; cb(null, file); }, cb => { - gutil.log(opts.title + ' ' + chalk.green(count + ' ' + plur('item', count))); + module.exports._log(options.title + ' ' + chalk.green(count + ' ' + plur('item', count))); cb(); }); }; + +// Internal: Log function used by gulp-debug exposed for testing +module.exports._log = fancyLog; -- cgit v1.2.3