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

csso

Package Overview
Dependencies
Maintainers
3
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csso - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

dist/csso-browser.js

4

HISTORY.md

@@ -0,1 +1,5 @@

## 1.5.2 (January 24, 2016)
- don't merge rulesets if between them a ruleset with same specificity (#264)
## 1.5.1 (January 14, 2016)

@@ -2,0 +6,0 @@

23

lib/compressor/restructure/markShorthands.js

@@ -1,2 +0,3 @@

var unsafeToMerge = /vh|vw|vmin|vmax|vm|rem|\\9/;
var allSidesAreEqual = /^(\S+)( \1){3}$/;
var unsafeToMerge = /vh|vw|vmin|vmax|vm|rem|\\9|inherit|unset|initial|revert/;

@@ -185,6 +186,2 @@ var TOP = 0;

if (top && right && bottom && left) {
if (unsafeToMerge.test([top.s, right.s, bottom.s, left.s].join(' '))) {
return false;
}
var important = top.important +

@@ -195,3 +192,17 @@ right.important +

return important === 0 || important === 4 || important === this.important;
if (important === 0 || important === 4 || important === this.important) {
var values = [top.s, right.s, bottom.s, left.s].join(' ');
console.log(values);
if (allSidesAreEqual.test(values)) {
return true;
}
if (unsafeToMerge.test(values)) {
return false;
}
return true;
}
}

@@ -198,0 +209,0 @@

@@ -11,4 +11,4 @@ var utils = require('./utils.js');

var compareMarkers = {};
compareMarkers[selector[0].info.compareMarker] = true;
var nodeCompareMarker = selector[0].info.compareMarker;
var skippedCompareMarkers = {};

@@ -28,3 +28,9 @@ for (i = i + 1; i < array.length; i++) {

var nextBlock = next.block.declarations;
var nextCompareMarker = nextFirstSelector.info.compareMarker;
// if next ruleset has same marked as one of skipped then stop joining
if (nextCompareMarker in skippedCompareMarkers) {
return;
}
// try to join by selectors

@@ -46,6 +52,5 @@ if (selector.length === 1) {

// try to join by properties
var nextCompareMarker = nextFirstSelector.info.compareMarker;
var equalBlocks = true;
if (block.length === nextBlock.length) {
var equalBlocks = true;
if (block.length === nextBlock.length) {
for (var j = 0; j < block.length; j++) {

@@ -68,3 +73,2 @@ if (block[j].info.s !== nextBlock[j].info.s) {

compareMarkers[nextCompareMarker] = true;
array.splice(i, 1);

@@ -77,7 +81,9 @@ i--;

// go to next ruleset if simpleselectors has no equal specifity and element selector
if (nextCompareMarker in compareMarkers) {
// go to next ruleset if current one can be skipped (has no equal specificity nor element selector)
if (nextCompareMarker === nodeCompareMarker) {
return;
}
skippedCompareMarkers[nextCompareMarker] = true;
}
};
{
"name": "csso",
"description": "CSSO — CSS optimizer",
"version": "1.5.1",
"version": "1.5.2",
"homepage": "https://github.com/css/csso",

@@ -6,0 +6,0 @@ "author": "Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (https://github.com/afelix)",

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