Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-zindex

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-zindex - npm Package Compare versions

Comparing version 4.0.0-rc.2 to 4.0.0

16

dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc