Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uglifyify

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uglifyify - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

27

index.js

@@ -8,2 +8,3 @@ var convert = require('convert-source-map')

module.exports = uglifyify
function uglifyify(file, opts) {

@@ -37,19 +38,21 @@ opts = opts || {}

var sourceMaps = buffer.match(
/\/\/[#@] sourceMappingURL=data:application\/json;base64,([a-zA-Z0-9+\/]+)={0,2}$/
/\/\/[#@] ?sourceMappingURL=data:application\/json;base64,([a-zA-Z0-9+\/]+)={0,2}$/
)
if (sourceMaps) {
opts.outSourceMap = 'out.js.map'
opts.inSourceMap = convert.fromJSON(
new Buffer(sourceMaps[1], 'base64').toString()
).sourcemap
}
opts.outSourceMap = 'out.js.map'
opts.inSourceMap = sourceMaps && convert.fromJSON(
new Buffer(sourceMaps[1], 'base64').toString()
).sourcemap
buffer = ujs.minify(buffer, opts)
this.queue(buffer.code)
var min = ujs.minify(buffer, opts)
this.queue(min.code)
if (sourceMaps) {
var map = convert.fromJSON(buffer.map)
if (min.map) {
var map = convert.fromJSON(min.map)
map.setProperty('sources', [file])
map.setProperty('sourcesContent', opts.inSourceMap.sourcesContent)
map.setProperty('sourcesContent', sourceMaps
? opts.inSourceMap.sourcesContent
: [buffer]
)
this.queue('\n')

@@ -56,0 +59,0 @@ this.queue(map.toComment())

{
"name": "uglifyify",
"version": "2.2.0",
"version": "2.3.0",
"description": "A browserify transform which minifies your code using UglifyJS2",

@@ -5,0 +5,0 @@ "main": "index.js",

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