New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fis-optimizer-uglify-js

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fis-optimizer-uglify-js - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

122

index.js

@@ -10,6 +10,126 @@ /*

function uglify(content, file, conf) {
conf.fromString = true;
if (conf.sourceMap) {
var mapping = fis.file.wrap(file.dirname + '/' + file.filename + '.map');
conf.outSourceMap = file.filename + '.org' + file.rExt;
}
var ret = UglifyJS.minify(content, conf);
if (conf.sourceMap) {
mapping.useDomain = true;
mapping.useHash = true;
var mapData = JSON.parse(ret.map);
mapData.sources = [mapData.file];
mapData.sourcesContent = [content];
var newData = {
version: mapData.version,
file: mapData.file,
sources: mapData.sources,
sourcesContent: mapData.sourcesContent,
names: mapData.names,
mappings: mapData.mappings
};
mapping.setContent(JSON.stringify(newData));
file.extras = file.extras || {};
file.extras.derived = file.extras.derived || [];
file.extras.derived.push(mapping);
ret.code += '\n//# sourceMappingURL=' + mapping.getUrl(fis.compile.settings.hash, fis.compile.settings.domain); + '\n';
}
return ret.code;
}
module.exports = function(content, file, conf){
try {
content = uglify(content, file, conf);
} catch (e) {
fis.log.warn('Got Error %s while uglify %s', e.message, file.subpath);
fis.log.debug(e.stack);
}
return content;
};
/*
* fis
* http://fis.baidu.com/
*/
'use strict';
var UglifyJS = require('uglify-js');
module.exports = function(content, file, conf){
conf.fromString = true;
if (conf.sourceMap) {
conf.outSourceMap = file.filename + '.org' + file.rExt;
conf.outSourceMap =/*
* fis
* http://fis.baidu.com/
*/
'use strict';
var UglifyJS = require('uglify-js');
function uglify(content, file, conf) {
conf.fromString = true;
if (conf.sourceMap) {
var mapping = fis.file.wrap(file.dirname + '/' + file.filename + '.map');
conf.outSourceMap = file.filename + '.org' + file.rExt;
}
var ret = UglifyJS.minify(content, conf);
if (conf.sourceMap) {
mapping.useDomain = true;
mapping.useHash = true;
var mapData = JSON.parse(ret.map);
mapData.sources = [mapData.file];
mapData.sourcesContent = [content];
var newData = {
version: mapData.version,
file: mapData.file,
sources: mapData.sources,
sourcesContent: mapData.sourcesContent,
names: mapData.names,
mappings: mapData.mappings
};
mapping.setContent(JSON.stringify(newData));
file.extras = file.extras || {};
file.extras.derived = file.extras.derived || [];
file.extras.derived.push(mapping);
ret.code += '\n//# sourceMappingURL=' + mapping.getUrl(fis.compile.settings.hash, fis.compile.settings.domain); + '\n';
}
return ret.code;
}
module.exports = function(content, file, conf){
try {
content = uglify(content, file, conf);
} catch (e) {
fis.log.warn('Got Error %s while uglify %s', e.message, file.subpath);
fis.log.debug(e.stack);
}
return content;
};
file.filename + '.org' + file.rExt;
}

@@ -16,0 +136,0 @@

2

package.json
{
"name" : "fis-optimizer-uglify-js",
"description" : "A optimizer for fis to compress js by using uglify-js.",
"version" : "0.1.8",
"version" : "0.1.9",
"author" : "FIS Team <fis@baidu.com>",

@@ -6,0 +6,0 @@ "homepage" : "http://fis.baidu.com/",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc