clean-css
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -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]; |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
368939
7776
3