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 4.0.0 to 4.0.1

5

lib/optimizer/level-1/optimize.js

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

var URL_PREFIX_PATTERN = /^url\(/i;
var VARIABLE_NAME_PATTERN = /^--\S+$/;

@@ -472,2 +473,6 @@ function isNegative(value) {

if (VARIABLE_NAME_PATTERN.test(name)) {
continue;
}
for (var j = 0, m = property.value.length; j < m; j++) {

@@ -474,0 +479,0 @@ type = property.value[j][0];

4

lib/reader/is-allowed-resource.js

@@ -12,3 +12,3 @@ var path = require('path');

var absoluteUri;
var allowed = true;
var allowed = isRemote ? false : true;
var rule;

@@ -49,3 +49,3 @@ var isNegated;

} else if (isRemote && rule == 'local') {
allowed = false;
allowed = allowed || false;
} else if (isRemote && rule == 'remote') {

@@ -52,0 +52,0 @@ allowed = true;

@@ -57,5 +57,5 @@ var fs = require('fs');

var inputAsImports = input.reduce(function (accumulator, uri) {
var normalizedUri = isRemoteResource(uri) ? uri : normalizePath(uri);
var normalizedUri = normalizeUri(uri);
accumulator.push(restoreAsRelativeImport(normalizedUri));
accumulator.push(restoreAsImport(normalizedUri));
return accumulator;

@@ -75,5 +75,5 @@ }, []);

source = input[uri];
normalizedUri = isRemoteResource(uri) ? uri : normalizePath(uri);
normalizedUri = normalizeUri(uri);
inputAsImports.push(restoreAsRelativeImport(normalizedUri));
inputAsImports.push(restoreAsImport(normalizedUri));

@@ -90,2 +90,21 @@ context.sourcesContent[normalizedUri] = source.styles;

function normalizeUri(uri) {
var currentPath = path.resolve('');
var absoluteUri;
var relativeToCurrentPath;
var normalizedUri;
if (isRemoteResource(uri)) {
return uri;
}
absoluteUri = isAbsoluteResource(uri) ?
uri :
path.resolve(uri);
relativeToCurrentPath = path.relative(currentPath, absoluteUri);
normalizedUri = normalizePath(relativeToCurrentPath);
return normalizedUri;
}
function trackSourceMap(sourceMap, uri, context) {

@@ -102,17 +121,4 @@ var parsedMap = typeof sourceMap == 'string' ?

function restoreAsRelativeImport(uri) {
var currentPath = path.resolve('');
var absoluteUri;
var relativeToCurrentPath;
if (isRemoteResource(uri)) {
return restoreImport(uri, '') + Marker.SEMICOLON;
} else {
absoluteUri = isAbsoluteResource(uri) ?
uri :
path.resolve(uri);
relativeToCurrentPath = path.relative(currentPath, absoluteUri);
return restoreImport(relativeToCurrentPath, '') + Marker.SEMICOLON;
}
function restoreAsImport(uri) {
return restoreImport(uri, '') + Marker.SEMICOLON;
}

@@ -119,0 +125,0 @@

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

// close brace after at-rule at rule level, e.g. a{@apply(--variable)}<--
propertyToken = null;
ruleToken = null;

@@ -314,2 +315,3 @@ serializedBuffer = buffer.join('').trim();

// close brace after a property block at rule level, e.g. a{--custom:{color:red;}<--
propertyToken = null;
ruleToken = ruleTokens.pop();

@@ -324,2 +326,3 @@ newTokens = ruleToken[2];

// close brace after a rule, e.g. a{color:red;}<--
propertyToken = null;
ruleToken = null;

@@ -326,0 +329,0 @@ newTokens = allTokens;

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

@@ -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