postcss-zindex
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -0,1 +1,5 @@ | ||
# 1.1.3 | ||
* Improved performance by iterating the AST in a single pass and caching nodes for the second iteration. | ||
# 1.1.2 | ||
@@ -2,0 +6,0 @@ |
12
index.js
@@ -8,13 +8,15 @@ 'use strict'; | ||
var cache = require('./lib/layerCache')(); | ||
var nodes = []; | ||
// First pass; cache all z indexes | ||
css.eachDecl('z-index', function (declaration) { | ||
cache.addValue(declaration.value); | ||
css.eachDecl('z-index', function (decl) { | ||
nodes.push(decl); | ||
cache.addValue(decl.value); | ||
}); | ||
// Second pass; optimise | ||
css.eachDecl('z-index', function (declaration) { | ||
nodes.forEach(function (decl) { | ||
// Need to coerce to string so that the | ||
// AST is updated correctly | ||
declaration.value = '' + cache.convert(declaration.value); | ||
}); | ||
decl.value = '' + cache.convert(decl.value); | ||
}) | ||
}; | ||
}); |
@@ -0,0 +0,0 @@ 'use strict'; |
{ | ||
"name": "postcss-zindex", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Reduce z-index values with PostCSS.", | ||
@@ -25,5 +25,5 @@ "main": "index.js", | ||
"jshint": "^2.6.3", | ||
"jshint-stylish": "^1.0.1", | ||
"tap-spec": "^2.2.2", | ||
"tape": "^3.5.0" | ||
"jshint-stylish": "^2.0.1", | ||
"tap-spec": "^4.0.2", | ||
"tape": "^4.1.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "homepage": "https://github.com/ben-eb/postcss-zindex", |
@@ -0,0 +0,0 @@ # [postcss][postcss]-zindex [![Build Status](https://travis-ci.org/ben-eb/postcss-zindex.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-zindex.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-zindex.svg)][deps] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
6116
56
1