From 363723fc84f7b8477592e0105aeb331ec9a017af Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Aug 2017 05:01:11 +0200 Subject: node_modules --- node_modules/gulp-debug/index.js | 57 +++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 27 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 94623fd1c..ce720ab38 100644 --- a/node_modules/gulp-debug/index.js +++ b/node_modules/gulp-debug/index.js @@ -1,44 +1,47 @@ 'use strict'; -var path = require('path'); -var gutil = require('gulp-util'); -var through = require('through2'); -var tildify = require('tildify'); -var stringifyObject = require('stringify-object'); -var chalk = require('chalk'); -var objectAssign = require('object-assign'); -var plur = require('plur'); -var prop = chalk.blue; - -module.exports = function (opts) { - opts = objectAssign({ +const path = require('path'); +const gutil = require('gulp-util'); +const through = require('through2'); +const tildify = require('tildify'); +const stringifyObject = require('stringify-object'); +const chalk = require('chalk'); +const plur = require('plur'); + +const prop = chalk.blue; + +module.exports = opts => { + opts = Object.assign({ title: 'gulp-debug:', - minimal: true + minimal: true, + showFiles: true }, opts); if (process.argv.indexOf('--verbose') !== -1) { opts.verbose = true; opts.minimal = false; + opts.showFiles = true; } - var count = 0; + let count = 0; - return through.obj(function (file, enc, cb) { - var 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, '').trimRight()) : '') + - '\n'; + return through.obj((file, enc, cb) => { + if (opts.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()) : '') + + '\n'; - var output = opts.minimal ? prop(path.relative(process.cwd(), file.path)) : full; + const output = opts.minimal ? prop(path.relative(process.cwd(), file.path)) : full; - count++; - - gutil.log(opts.title + ' ' + output); + gutil.log(opts.title + ' ' + output); + } + count++; cb(null, file); - }, function (cb) { + }, cb => { gutil.log(opts.title + ' ' + chalk.green(count + ' ' + plur('item', count))); cb(); }); -- cgit v1.2.3