postcss-zindex
Advanced tools
Comparing version 4.0.0-rc.2 to 4.0.0
@@ -15,11 +15,9 @@ 'use strict'; | ||
exports.default = (0, _postcss.plugin)('postcss-zindex', function () { | ||
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return function (css) { | ||
var cache = new _layerCache2.default(opts); | ||
var nodes = []; | ||
var abort = false; | ||
exports.default = (0, _postcss.plugin)('postcss-zindex', (opts = {}) => { | ||
return css => { | ||
const cache = new _layerCache2.default(opts); | ||
const nodes = []; | ||
let abort = false; | ||
// First pass; cache all z indexes | ||
css.walkDecls('z-index', function (decl) { | ||
css.walkDecls(/z-index/i, decl => { | ||
// Check that no negative values exist. Rebasing is only | ||
@@ -45,3 +43,3 @@ // safe if all indices are positive numbers. | ||
// Second pass; optimize | ||
nodes.forEach(function (decl) { | ||
nodes.forEach(decl => { | ||
// Need to coerce to string so that the | ||
@@ -48,0 +46,0 @@ // AST is updated correctly |
@@ -43,3 +43,3 @@ 'use strict'; | ||
LayerCache.prototype.addValue = function (value) { | ||
var parsedValue = parseInt(value, 10); | ||
let parsedValue = parseInt(value, 10); | ||
// pass only valid values | ||
@@ -53,3 +53,3 @@ if (!parsedValue || parsedValue < 0) { | ||
LayerCache.prototype.getValue = function (value) { | ||
var parsedValue = parseInt(value, 10); | ||
let parsedValue = parseInt(value, 10); | ||
return this._findValue(parsedValue) || value; | ||
@@ -56,0 +56,0 @@ }; |
{ | ||
"name": "postcss-zindex", | ||
"version": "4.0.0-rc.2", | ||
"version": "4.0.0", | ||
"description": "Reduce z-index values with PostCSS.", | ||
@@ -30,5 +30,5 @@ "main": "dist/index.js", | ||
"babel-cli": "^6.0.0", | ||
"cross-env": "^3.0.0" | ||
"cross-env": "^5.0.0" | ||
}, | ||
"homepage": "https://github.com/ben-eb/cssnano", | ||
"homepage": "https://github.com/cssnano/cssnano", | ||
"author": { | ||
@@ -39,9 +39,9 @@ "name": "Ben Briggs", | ||
}, | ||
"repository": "ben-eb/cssnano", | ||
"repository": "cssnano/cssnano", | ||
"bugs": { | ||
"url": "https://github.com/ben-eb/cssnano/issues" | ||
"url": "https://github.com/cssnano/cssnano/issues" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
"node": ">=6.9.0" | ||
} | ||
} |
@@ -79,3 +79,3 @@ # [postcss][postcss]-zindex | ||
See [CONTRIBUTORS.md](https://github.com/ben-eb/cssnano/blob/master/CONTRIBUTORS.md). | ||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md). | ||
@@ -82,0 +82,0 @@ ## License |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the 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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
8185
81
1