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

uglifycss

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uglifycss - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

tests/_munge.js

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Port of YUI CSS Compressor to NodeJS",
"version": "0.0.15",
"version": "0.0.16",
"keywords": [

@@ -8,0 +8,0 @@ "css",

@@ -5,2 +5,4 @@ UglifyCSS is a port of [YUI Compressor](https://github.com/yui/yuicompressor) to [NodeJS](http://nodejs.org) for its CSS part. Its name is a reference to the awesome [UglifyJS](https://github.com/mishoo/UglifyJS) but UglifyCSS is not a CSS parser. Like YUI CSS Compressor, it applies many regexp replacements. Note that a [port to JavaScript](https://github.com/yui/ycssmin) is also available in the YUI Compressor repository.

Be sure to submit valid CSS to UglifyCSS or you could get weird results.
### Installation

@@ -7,0 +9,0 @@

@@ -260,2 +260,31 @@ /**

// Collect all comment blocks and return new content with comment placeholders
// (comments is an array thus passed by reference)
function collectComments(content, comments) {
var table = [];
var from = 0;
var start, end;
while (true) {
start = content.indexOf("/*", from);
if (start > -1) {
end = content.indexOf("*/", start + 2);
if (end > -1) {
comments.push(content.slice(start + 2, end));
table.push(content.slice(from, start));
table.push("/*___PRESERVE_CANDIDATE_COMMENT_" + (comments.length - 1) + "___*/");
from = end + 2;
} else {
// unterminated comment
end = -2;
break;
}
} else {
break;
}
}
table.push(content.slice(end + 2));
return table.join("");
}
// Uglify a CSS string

@@ -266,3 +295,2 @@

var startIndex,
endIndex,
comments = [],

@@ -282,25 +310,8 @@ preservedTokens = [],

lines = [],
vars = {},
partial;
vars = {};
options = options || defaultOptions;
content = extractDataUrls(content, preservedTokens);
content = collectComments(content, comments);
// collect all comment blocks...
content = content.split("/*");
partial = "";
for (i = 0, c = content.length; i < c; ++i) {
endIndex = content[i].indexOf("*/");
if (endIndex > -1) {
comments.push(partial + content[i].slice(0, endIndex));
partial = "";
content[i] = "/*___PRESERVE_CANDIDATE_COMMENT_" + (comments.length - 1) + "___" + content[i].slice(endIndex);
} else if (i > 0) {
partial += content[i];
content[i] = "";
}
}
content = content.join("") + partial;
// preserve strings so their content doesn't get accidentally minified

@@ -307,0 +318,0 @@ pattern = /("([^\\"]|\\.|\\)*")|('([^\\']|\\.|\\)*')/g;

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