postcss-merge-idents
Advanced tools
Comparing version 2.1.3 to 2.1.4
@@ -0,1 +1,6 @@ | ||
# 2.1.4 | ||
* Fixed a range error which happened when duplicated at rules were found | ||
in the stylesheet. | ||
# 2.1.3 | ||
@@ -2,0 +7,0 @@ |
31
index.js
@@ -30,14 +30,19 @@ 'use strict'; | ||
})[0]; | ||
if (!relevant) { return; } | ||
var toString = node.nodes.toString(); | ||
var cached = relevant.cache.filter(function (c) { | ||
return c.name === node.name && String(c.nodes) === toString; | ||
}); | ||
var cache = relevant.cache; | ||
if (cached.length) { | ||
relevant.replacements[cached[0].params] = node.params; | ||
cached[0].remove(); | ||
relevant.cache = cache.splice(cache.indexOf(cached[0]) + 1, 1); | ||
if (!relevant) { | ||
return; | ||
} | ||
relevant.cache.push(node); | ||
if (relevant.cache.length < 1) { | ||
relevant.cache.push(node); | ||
return; | ||
} else { | ||
var toString = node.nodes.toString(); | ||
relevant.cache.forEach(function (cached) { | ||
if (cached.name === node.name && cached.nodes.toString() === toString) { | ||
cached.remove(); | ||
relevant.replacements[cached.params] = node.params; | ||
} | ||
}); | ||
relevant.cache.push(node); | ||
return; | ||
} | ||
} | ||
@@ -48,3 +53,5 @@ if (node.type === 'decl') { | ||
})[0]; | ||
if (!relevant) { return; } | ||
if (!relevant) { | ||
return; | ||
} | ||
relevant.decls.push(node); | ||
@@ -51,0 +58,0 @@ } |
{ | ||
"name": "postcss-merge-idents", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Merge keyframe and counter style identifiers.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
6718
80