diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
commit | cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch) | |
tree | 92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/gulp-gzip/lib/utils.js | |
parent | 3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff) |
remove node_modules
Diffstat (limited to 'node_modules/gulp-gzip/lib/utils.js')
-rwxr-xr-x | node_modules/gulp-gzip/lib/utils.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/node_modules/gulp-gzip/lib/utils.js b/node_modules/gulp-gzip/lib/utils.js deleted file mode 100755 index 5658e1ca1..000000000 --- a/node_modules/gulp-gzip/lib/utils.js +++ /dev/null @@ -1,43 +0,0 @@ -var bytes = require('bytes'); - -// Merge source object with target object while handling threshold option -// Used to merge user defined plugin options with default options -function merge(target, source) { - if (typeof source === 'undefined') source = {}; - - Object.keys(source).forEach(function(key) { - if (key === 'threshold') { - target[key] = threshold(source[key]); - } else { - target[key] = source[key]; - } - }); - - return target; -} - -// Parse the threshold plugin option -// Specifies the minimum file size that will be compressed -// Can be a string, number, or boolean -function threshold(obj) { - var ret; - - switch (typeof obj) { - case 'string': - ret = bytes(obj) < 150 ? 150 : bytes(obj); - break; - case 'number': - ret = obj < 150 ? 150 : obj; - break; - case 'boolean': - ret = obj === false ? false : 150; - break; - default: - throw new Error('threshold must be String|Number|Boolean'); - } - - return ret; -} - -exports.merge = merge; -exports.threshold = threshold; |