postcss-discard-duplicates
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -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 @@ |
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5506
72
41
Updatedpostcss@^4.1.10