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.14 to 0.2.0

33

index.js

@@ -10,2 +10,3 @@ /*

var util = require('util');
var mergeMap = require('merge-source-map');

@@ -16,4 +17,4 @@ function uglify(content, file, conf) {

if (conf.sourceMap) {
var mapping = fis.file.wrap(file.dirname + '/' + file.filename + '.map');
conf.outSourceMap = file.filename + '.org' + file.rExt;
var mapping = fis.file.wrap(file.dirname + '/' + file.filename + file.rExt + '.map');
conf.outSourceMap = mapping.subpath;
}

@@ -24,8 +25,5 @@

if (conf.sourceMap) {
// mapping.useDomain = true;
// mapping.useHash = true;
var mapData = JSON.parse(ret.map);
mapData.sources = [mapData.file];
mapData.sources = [file.subpath];
mapData.sourcesContent = [content];

@@ -42,4 +40,12 @@

mapping.setContent(JSON.stringify(newData));
var originMapFile = getMapFile(file);
if (originMapFile) {
file.extras.derived.shift();
var merged = mergeMap(JSON.parse(originMapFile.getContent()), newData);
mapping.setContent(JSON.stringify(merged));
} else {
mapping.setContent(JSON.stringify(newData));
}
file.extras = file.extras || {};

@@ -68,1 +74,14 @@ file.extras.derived = file.extras.derived || [];

};
function getMapFile(file) {
var derived = file.derived;
if (!derived || !derived.length) {
derived = file.extras && file.extras.derived;
}
if (derived && derived[0] && derived[0].rExt === '.map') {
return derived[0];
}
return null;
}
{
"name" : "fis-optimizer-uglify-js",
"description" : "A optimizer for fis to compress js by using uglify-js.",
"version" : "0.1.14",
"author" : "FIS Team <fis@baidu.com>",
"homepage" : "http://fis.baidu.com/",
"keywords": [ "fis" ],
"main" : "index.js",
"repository": {
"type": "git",
"url": "https://github.com/fis-dev/fis-optimizer-uglify-js.git"
},
"engines" : {
"node" : ">= 0.8.0"
},
"scripts" : {
"test" : "mocha test/ut --recursive"
},
"dependencies" : {
"uglify-js" : "2.4.15"
}
"name": "fis-optimizer-uglify-js",
"description": "A optimizer for fis to compress js by using uglify-js.",
"version": "0.2.0",
"author": "FIS Team <fis@baidu.com>",
"homepage": "http://fis.baidu.com/",
"keywords": [
"fis"
],
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/fis-dev/fis-optimizer-uglify-js.git"
},
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "mocha test/ut --recursive"
},
"dependencies": {
"merge-source-map": "^1.0.1",
"uglify-js": "^2.4.15"
}
}
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