Socket
Socket
Sign inDemoInstall

postcss-unique-selectors

Package Overview
Dependencies
9
Maintainers
7
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0-nightly.2020.1.9 to 4.0.0-nightly.2020.1.11

45

dist/index.js

@@ -8,4 +8,2 @@ "use strict";

var _postcss = require("postcss");
var _alphanumSort = _interopRequireDefault(require("alphanum-sort"));

@@ -29,22 +27,31 @@

var _default = (0, _postcss.plugin)('postcss-unique-selectors', () => {
return css => css.walkRules(nodes => {
let comments = [];
nodes.selector = parseSelectors(nodes.selector, selNode => {
selNode.walk(sel => {
if (sel.type === 'comment') {
comments.push(sel.value);
sel.remove();
return;
} else {
return sel;
}
function pluginCreator() {
return {
postcssPlugin: 'postcss-unique-selectors',
OnceExit(css) {
css.walkRules(nodes => {
let comments = [];
nodes.selector = parseSelectors(nodes.selector, selNode => {
selNode.walk(sel => {
if (sel.type === 'comment') {
comments.push(sel.value);
sel.remove();
return;
} else {
return sel;
}
});
});
unique(nodes);
nodes.selectors = nodes.selectors.concat(comments);
});
});
unique(nodes);
nodes.selectors = nodes.selectors.concat(comments);
});
});
}
};
}
pluginCreator.postcss = true;
var _default = pluginCreator;
exports.default = _default;
module.exports = exports.default;
{
"name": "postcss-unique-selectors",
"version": "4.0.0-nightly.2020.1.9",
"version": "4.0.0-nightly.2020.1.11",
"description": "Ensure CSS selectors are unique.",

@@ -30,3 +30,2 @@ "main": "dist/index.js",

"alphanum-sort": "^1.0.2",
"postcss": "^7.0.16",
"postcss-selector-parser": "^6.0.2",

@@ -40,3 +39,9 @@ "uniqs": "^2.0.0"

"node": ">=10.13.0"
},
"devDependencies": {
"postcss": "^8.2.1"
},
"peerDependencies": {
"postcss": "^8.2.1"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc