postcss-normalize-timing-functions
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -35,5 +35,5 @@ 'use strict'; | ||
const value = node.value.toLowerCase(); | ||
const lowerCasedValue = node.value.toLowerCase(); | ||
if (value === 'steps') { | ||
if (lowerCasedValue === 'steps') { | ||
// Don't bother checking the step-end case as it has the same length | ||
@@ -44,13 +44,19 @@ // as steps(1) | ||
node.value = 'step-start'; | ||
delete node.nodes; | ||
return; | ||
} | ||
// The end case is actually the browser default, so it isn't required. | ||
if (node.nodes[2] && node.nodes[2].value.toLowerCase() === 'end') { | ||
node.nodes = [node.nodes[0]]; | ||
return; | ||
} | ||
return false; | ||
} | ||
if (value === 'cubic-bezier') { | ||
if (lowerCasedValue === 'cubic-bezier') { | ||
const match = getMatch(node.nodes.filter(evenValues).map(getValue)); | ||
@@ -61,3 +67,5 @@ | ||
node.value = match; | ||
delete node.nodes; | ||
return; | ||
@@ -70,4 +78,17 @@ } | ||
return css => { | ||
const cache = {}; | ||
css.walkDecls(/(animation|transition)(-timing-function|$)/i, decl => { | ||
decl.value = (0, _postcssValueParser2.default)(decl.value).walk(reduce).toString(); | ||
const value = decl.value; | ||
if (cache[value]) { | ||
decl.value = cache[value]; | ||
return; | ||
} | ||
const result = (0, _postcssValueParser2.default)(value).walk(reduce).toString(); | ||
decl.value = result; | ||
cache[value] = result; | ||
}); | ||
@@ -74,0 +95,0 @@ }; |
{ | ||
"name": "postcss-normalize-timing-functions", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Normalize CSS animation/transition timing functions.", | ||
@@ -5,0 +5,0 @@ "main": "dist/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
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
5388
68
0
5