Socket
Socket
Sign inDemoInstall

postcss-reduce-idents

Package Overview
Dependencies
Maintainers
8
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-reduce-idents - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

2

package.json
{
"name": "postcss-reduce-idents",
"version": "6.0.0",
"version": "6.0.1",
"description": "Reduce custom identifiers with PostCSS.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -17,2 +17,4 @@ 'use strict';

'grid-template-areas',
'grid-template-columns',
'grid-template-rows',
]);

@@ -57,2 +59,16 @@

}
/* handle gridline name lists like [name1 name2] */
if (child.type === 'word') {
const word = child.value;
if (word.startsWith('[') && word.endsWith(']')) {
const gridLine = word.slice(1, -1);
addToCache(gridLine, encoder, cache);
} else if (word.startsWith('[')) {
const gridLine = word.slice(1);
addToCache(gridLine, encoder, cache);
} else if (word.endsWith(']')) {
const gridLine = word.slice(0, -1);
addToCache(gridLine, encoder, cache);
}
}
});

@@ -84,2 +100,26 @@

}
/* replace gridline names inside lists like [name] */
if (
word.startsWith('[') &&
word.endsWith(']') &&
word.slice(1, -1) in cache
) {
const gridLine = word.slice(1, -1);
node.value = node.value.replace(
gridLine,
cache[gridLine].ident
);
} else if (word.startsWith('[') && word.slice(1) in cache) {
const gridLine = word.slice(1);
node.value = node.value.replace(
gridLine,
cache[gridLine].ident
);
} else if (word.endsWith(']') && word.slice(0, -1) in cache) {
const gridLine = word.slice(0, -1);
node.value = node.value.replace(
gridLine,
cache[gridLine].ident
);
}
});

@@ -86,0 +126,0 @@ node.value = node.value.replace(/\s+/g, ' '); // merge white-spaces

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