Socket
Socket
Sign inDemoInstall

postcss-unique-selectors

Package Overview
Dependencies
7
Maintainers
8
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.4 to 5.1.0

types/index.d.ts

6

package.json
{
"name": "postcss-unique-selectors",
"version": "5.0.4",
"version": "5.1.0",
"description": "Ensure CSS selectors are unique.",
"main": "src/index.js",
"types": "types/index.d.ts",
"files": [
"LICENSE-MIT",
"src"
"src",
"types"
],

@@ -10,0 +12,0 @@ "keywords": [

'use strict';
const selectorParser = require('postcss-selector-parser');
/**
* @param {string} selectors
* @param {selectorParser.SyncProcessor<void>} callback
* @return {string}
*/
function parseSelectors(selectors, callback) {

@@ -8,2 +13,6 @@ return selectorParser(callback).processSync(selectors);

/**
* @param {import('postcss').Rule} rule
* @return {void}
*/
function unique(rule) {

@@ -15,2 +24,6 @@ const selector = [...new Set(rule.selectors)];

/**
* @type {import('postcss').PluginCreator<void>}
* @return {import('postcss').Plugin}
*/
function pluginCreator() {

@@ -21,2 +34,3 @@ return {

css.walkRules((nodes) => {
/** @type {string[]} */
let comments = [];

@@ -23,0 +37,0 @@ nodes.selector = parseSelectors(nodes.selector, (selNode) => {

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