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

clean-css

Package Overview
Dependencies
Maintainers
2
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-css - npm Package Compare versions

Comparing version 5.1.1 to 5.1.2

29

lib/optimizer/level-1/tidy-rules.js

@@ -19,2 +19,14 @@ var Spaces = require('../../options/format').Spaces;

var PSEUDO_CLASSES_WITH_SELECTORS = [
':current',
':future',
':has',
':host',
':host-context',
':is',
':not',
':past',
':where'
];
function hasInvalidCharacters(value) {

@@ -61,4 +73,5 @@ var isEscaped;

var isWhitespace;
var isPseudoClass = value[0] == Marker.COLON;
var isSpaceAwarePseudoClass;
var roundBracketLevel = 0;
var wasComma = false;
var wasRelation = false;

@@ -78,2 +91,5 @@ var wasWhitespace = false;

isWhitespace = WHITESPACE_PATTERN.test(character);
isSpaceAwarePseudoClass = roundBracketLevel == 1 && character == Marker.CLOSE_ROUND_BRACKET ?
false :
isSpaceAwarePseudoClass || (roundBracketLevel === 0 && character == Marker.COLON && isPseudoClassWithSelectors(value, i));

@@ -118,3 +134,5 @@ if (wasEscaped && isQuoted && isNewLineWin) {

stripped.push(character);
} else if (isWhitespace && !wasWhitespace && roundBracketLevel > 0 && isPseudoClass) {
} else if (isWhitespace && !wasWhitespace && wasComma && roundBracketLevel > 0 && isSpaceAwarePseudoClass) {
// skip space
} else if (isWhitespace && !wasWhitespace && roundBracketLevel > 0 && isSpaceAwarePseudoClass) {
stripped.push(character);

@@ -143,2 +161,3 @@ } else if (isWhitespace && (isAttribute || roundBracketLevel > 0) && !isQuoted) {

wasWhitespace = isWhitespace;
wasComma = character == Marker.COMMA;
}

@@ -151,2 +170,8 @@

function isPseudoClassWithSelectors(value, colonPosition) {
var pseudoClass = value.substring(colonPosition, value.indexOf(Marker.OPEN_ROUND_BRACKET, colonPosition));
return PSEUDO_CLASSES_WITH_SELECTORS.indexOf(pseudoClass) > -1;
}
function removeQuotes(value) {

@@ -153,0 +178,0 @@ if (value.indexOf('\'') == -1 && value.indexOf('"') == -1) {

2

package.json
{
"name": "clean-css",
"version": "5.1.1",
"version": "5.1.2",
"author": "Jakub Pawlowicz <contact@jakubpawlowicz.com> (https://jakubpawlowicz.com)",

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

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

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