Socket
Socket
Sign inDemoInstall

gulp-uglify

Package Overview
Dependencies
253
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.1.1

2

index.js

@@ -6,3 +6,3 @@ 'use strict';

module.exports = function (opts) {
module.exports = function(opts) {
return minifier(opts, uglify);

@@ -9,0 +9,0 @@ };

'use strict';
var makeErrorCause = require('make-error-cause');
module.exports = makeErrorCause('GulpUglifyError');
var gulpUglifyError = makeErrorCause('GulpUglifyError');
gulpUglifyError.prototype.toString = function() {
var cause = this.cause || {};
return makeErrorCause.BaseError.prototype.toString.call(this) +
(this.fileName ? '\nFile: ' + this.fileName : '') +
(cause.line ? '\nLine: ' + cause.line : '');
};
module.exports = gulpUglifyError;

@@ -7,10 +7,13 @@ 'use strict';

each(function (level) {
module.exports[level] = function () {
if (hasLog()) {
var log = require('gulplog');
each(
function(level) {
module.exports[level] = function() {
if (hasLog()) {
var log = require('gulplog');
log[level].apply(log, arguments);
}
};
}, levels);
log[level].apply(log, arguments);
}
};
},
levels
);

@@ -41,3 +41,3 @@ 'use strict';

} else if (options.preserveComments === 'some') {
// preserve comments with directives or that start with a bang (!)
// Preserve comments with directives or that start with a bang (!)
options.output.comments = /^!|@preserve|@license|@cc_on/i;

@@ -53,3 +53,3 @@ } else if (options.preserveComments === 'license') {

module.exports = function (opts, uglify) {
module.exports = function(opts, uglify) {
function minify(file, encoding, callback) {

@@ -75,12 +75,18 @@ var options = setup(opts || {});

sources = zipObject(file.sourceMap.sources, file.sourceMap.sourcesContent);
sources = zipObject(
file.sourceMap.sources,
file.sourceMap.sourcesContent
);
}
var mangled = trycatch(function () {
var map = {};
map[file.relative] = String(file.contents);
var m = uglify.minify(map, options);
m.code = new Buffer(m.code.replace(reSourceMapComment, ''));
return m;
}, createError(file, 'unable to minify JavaScript'));
var mangled = trycatch(
function() {
var map = {};
map[file.relative] = String(file.contents);
var m = uglify.minify(map, options);
m.code = new Buffer(m.code.replace(reSourceMapComment, ''));
return m;
},
createError(file, 'unable to minify JavaScript')
);

@@ -87,0 +93,0 @@ if (mangled instanceof GulpUglifyError) {

{
"name": "gulp-uglify",
"description": "Minify files with UglifyJS.",
"version": "2.1.0",
"version": "2.1.1",
"author": "Terin Stock <terinjokes@gmail.com>",
"bugs": "https://github.com/terinjokes/gulp-uglify/issues",
"dependencies": {
"eslint": "^3.18.0",
"eslint-config-prettier": "^1.5.0",
"eslint-config-xo": "^0.18.1",
"eslint-plugin-no-use-extend-native": "^0.3.12",
"eslint-plugin-prettier": "^2.0.1",
"eslint-plugin-unicorn": "^2.1.0",
"gulplog": "^1.0.0",

@@ -12,2 +18,3 @@ "has-gulplog": "^0.1.0",

"make-error-cause": "^1.1.1",
"prettier": "^0.22.0",
"through2": "^2.0.0",

@@ -30,4 +37,3 @@ "uglify-js": "~2.8.10",

"testdouble": "^1.6.0",
"vinyl": "^2.0.0",
"xo": "^0.16.0"
"vinyl": "^2.0.0"
},

@@ -41,4 +47,27 @@ "homepage": "https://github.com/terinjokes/gulp-uglify/",

"repository": "terinjokes/gulp-uglify",
"xo": {
"space": true
"eslintConfig": {
"env": {
"node": true
},
"extends": [
"xo",
"prettier"
],
"plugins": [
"unicorn",
"no-use-extend-native",
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"printWidth": 80,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false
}
]
}
},

@@ -51,3 +80,4 @@ "files": [

"scripts": {
"test": "xo && mocha --require intelli-espower-loader",
"lint": "eslint *.js lib test",
"test": "mocha --require intelli-espower-loader",
"coverage": "cat ./coverage/lcov.info | coveralls"

@@ -54,0 +84,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc