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

postcss-discard-duplicates

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-discard-duplicates - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 1.1.3
* Improved documentation for compatibility with the plugin guidelines.
* Simplify main source code.
# 1.1.2

@@ -2,0 +7,0 @@

8

index.js

@@ -5,6 +5,2 @@ 'use strict';

function getIdent (rule) {
return '' + rule;
}
function filterIdent (cache) {

@@ -19,3 +15,3 @@ return function (node) {

}
return sameContext && getIdent(node) === getIdent(cache);
return sameContext && String(node) === String(cache);
};

@@ -31,3 +27,3 @@ }

cached[0].removeSelf();
cache.splice([cache.indexOf(cached[0])], 1);
cache.splice(cache.indexOf(cached[0]), 1);
}

@@ -34,0 +30,0 @@ cache.push(rule);

{
"name": "postcss-discard-duplicates",
"version": "1.1.2",
"version": "1.1.3",
"description": "Discard duplicate rules in your CSS files with PostCSS.",

@@ -15,7 +15,7 @@ "main": "index.js",

"postcss",
"postcss-plugins"
"postcss-plugin"
],
"license": "MIT",
"dependencies": {
"postcss": "^4.1.2"
"postcss": "^4.1.10"
},

@@ -22,0 +22,0 @@ "devDependencies": {

@@ -5,4 +5,6 @@ # [postcss][postcss]-discard-duplicates [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-duplicates.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-duplicates.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-duplicates.svg)][deps]

Install via [npm](https://npmjs.org/package/postcss-discard-duplicates):
## Install
With [npm](https://npmjs.org/package/postcss-discard-duplicates) do:
```

@@ -14,12 +16,2 @@ npm install postcss-discard-duplicates --save

```js
var postcss = require('postcss')
var duplicates = require('postcss-discard-duplicates');
var css = 'h1{margin:0 auto;margin:0 auto}h1{margin:0 auto}';
console.log(postcss(duplicates()).process(css).css);
// => 'h1{margin:0 auto}'
```
This module will remove all duplicate rules from your stylesheets. It works on

@@ -43,2 +35,28 @@ at rules, normal rules and declarations. Note that this module does not have any

### Input
```css
h1 {
margin: 0 auto;
margin: 0 auto
}
h1 {
margin: 0 auto
}
```
### Output
```css
h1 {
margin: 0 auto
}
```
## Usage
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
examples for your environment.
## Contributing

@@ -45,0 +63,0 @@

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