Socket
Socket
Sign inDemoInstall

clean-css

Package Overview
Dependencies
1
Maintainers
2
Versions
211
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.7 to 4.1.8

13

lib/optimizer/level-1/optimize.js

@@ -32,2 +32,3 @@ var shortenHex = require('./shorten-hex');

var HEX_VALUE_PATTERN = /[0-9a-f]/i;
var PROPERTY_NAME_PATTERN = /^(?:\-chrome\-|\-[\w\-]+\w|\w[\w\-]+\w|\-\-\S+)$/;

@@ -102,7 +103,11 @@ var IMPORT_PREFIX_PATTERN = /^@import/i;

})
.replace(/(^|[^='"])#([0-9a-f]{6})($|[^0-9a-f])/gi, function (match, prefix, color, suffix) {
if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) {
return (prefix + '#' + color[0] + color[2] + color[4]).toLowerCase() + suffix;
.replace(/(^|[^='"])#([0-9a-f]{6})/gi, function (match, prefix, color, at, inputValue) {
var suffix = inputValue[at + match.length];
if (suffix && HEX_VALUE_PATTERN.test(suffix)) {
return match;
} else if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) {
return (prefix + '#' + color[0] + color[2] + color[4]).toLowerCase();
} else {
return (prefix + '#' + color).toLowerCase() + suffix;
return (prefix + '#' + color).toLowerCase();
}

@@ -109,0 +114,0 @@ })

@@ -291,3 +291,2 @@ var fs = require('fs');

var importedStyles;
var importedTokens;
var isAllowed = isAllowedResource(uri, false, inlinerContext.inline);

@@ -320,6 +319,10 @@ var normalizedPath = normalizePath(relativeToCurrentPath);

importedTokens = fromStyles(importedStyles, inlinerContext.externalContext, inlinerContext, function (tokens) { return tokens; });
importedTokens = wrapInMedia(importedTokens, mediaQuery, metadata);
return fromStyles(importedStyles, inlinerContext.externalContext, inlinerContext, function (importedTokens) {
importedTokens = wrapInMedia(importedTokens, mediaQuery, metadata);
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(importedTokens);
inlinerContext.outputTokens = inlinerContext.outputTokens.concat(importedTokens);
inlinerContext.sourceTokens = inlinerContext.sourceTokens.slice(1);
return doInlineImports(inlinerContext);
});
}

@@ -326,0 +329,0 @@

@@ -100,2 +100,3 @@ var Marker = require('./marker');

var wasCommentEnd = false;
var isCommentEndMarker;
var isEscaped;

@@ -115,3 +116,4 @@ var wasEscaped = false;

isCommentStart = !wasCommentEnd && level != Level.COMMENT && !isQuoted && character == Marker.ASTERISK && source[position.index - 1] == Marker.FORWARD_SLASH;
isCommentEnd = !wasCommentStart && level == Level.COMMENT && character == Marker.FORWARD_SLASH && source[position.index - 1] == Marker.ASTERISK;
isCommentEndMarker = !wasCommentStart && !isQuoted && character == Marker.FORWARD_SLASH && source[position.index - 1] == Marker.ASTERISK;
isCommentEnd = level == Level.COMMENT && isCommentEndMarker;

@@ -152,2 +154,5 @@ metadata = buffer.length === 0 ?

buffer = buffers.pop() || [];
} else if (isCommentEndMarker && source[position.index + 1] != Marker.ASTERISK) {
externalContext.warnings.push('Unexpected \'*/\' at ' + formatPosition([position.line, position.column, position.source]) + '.');
buffer = [];
} else if (character == Marker.SINGLE_QUOTE && !isQuoted) {

@@ -154,0 +159,0 @@ // single quotation start, e.g. a[href^='https<--

{
"name": "clean-css",
"version": "4.1.7",
"version": "4.1.8",
"author": "Jakub Pawlowicz <contact@jakubpawlowicz.com> (http://twitter.com/jakubpawlowicz)",

@@ -5,0 +5,0 @@ "description": "A well-tested CSS minifier",

@@ -440,3 +440,3 @@ <h1 align="center">

console.log(output.stats.timeSpent); // time spent on optimizations in milliseconds
console.log(output.stats.efficiency); // a ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes)
console.log(output.stats.efficiency); // `(originalSize - minifiedSize) / originalSize`, e.g. 0.25 if size is reduced from 100 bytes to 75 bytes
```

@@ -443,0 +443,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc