Socket
Socket
Sign inDemoInstall

postcss-discard-duplicates

Package Overview
Dependencies
11
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# 2.0.2
* Major performance boost by lessening algorithmic complexity; each node is
now cached and the nested loop removed, meaning that each node is cast to a
string only once (thanks to @asztal).
# 2.0.1

@@ -2,0 +8,0 @@

28

dist/index.js

@@ -18,21 +18,21 @@ 'use strict';

root.each(function (node, index) {
if (node.type === 'comment') {
var toRemove = [];
var map = {};
root.each(function (node) {
if (node.type === "comment") {
return;
}
var nodes = node.parent.nodes;
var toString = node.toString();
var result = [node];
for (var i = index + 1, max = nodes.length; i < max; i++) {
if (nodes[i].toString() === toString) {
result.push(nodes[i]);
}
var str = node.toString();
var existing = map[str];
if (existing) {
toRemove.push(existing);
}
map[str] = node;
});
for (var i = result.length - 2; ~i; i -= 1) {
result[i].remove();
}
});
while (toRemove.length > 0) {
toRemove.pop().remove();
}
}

@@ -39,0 +39,0 @@

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

@@ -11,5 +11,8 @@ "main": "dist/index.js",

"scripts": {
"contributorAdd": "all-contributors add",
"contributorGenerate": "all-contributors generate",
"pretest": "eslint src",
"prepublish": "de dist && babel src --out-dir dist --ignore /__tests__/",
"test": "ava src/__tests__"
"prepublish": "del-cli dist && babel src --out-dir dist --ignore /__tests__/",
"test": "ava src/__tests__",
"test-012": "ava src/__tests__"
},

@@ -28,11 +31,16 @@ "keywords": [

"devDependencies": {
"ava": "^0.11.0",
"all-contributors-cli": "^3.0.5",
"ava": "^0.16.0",
"babel-cli": "^6.3.17",
"babel-core": "^6.3.26",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015-loose": "^6.1.4",
"babel-plugin-add-module-exports": "^0.2.0",
"babel-preset-es2015": "^6.5.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-stage-0": "^6.3.13",
"del-cli": "^0.1.2",
"eslint": "^1.10.3",
"eslint-config-cssnano": "^1.0.0"
"babel-register": "^6.9.0",
"del-cli": "^0.2.0",
"eslint": "^3.0.0",
"eslint-config-cssnano": "^3.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-import": "^2.0.1"
},

@@ -50,4 +58,4 @@ "homepage": "https://github.com/ben-eb/postcss-discard-duplicates",

"ava": {
"require": "babel-core/register"
"require": "babel-register"
}
}

@@ -59,11 +59,20 @@ # [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]

## Contributing
## Contributors
Pull requests are welcome. If you add functionality, then please add unit tests
to cover it.
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars.githubusercontent.com/u/1282980?v=3" width="100px;"/><br /><sub>Ben Briggs</sub>](http://beneb.info)<br />[💻](https://github.com/ben-eb/postcss-discard-duplicates/commits?author=ben-eb) [📖](https://github.com/ben-eb/postcss-discard-duplicates/commits?author=ben-eb) 👀 [⚠️](https://github.com/ben-eb/postcss-discard-duplicates/commits?author=ben-eb) | [<img src="https://avatars.githubusercontent.com/u/5635476?v=3" width="100px;"/><br /><sub>Bogdan Chadkin</sub>](https://github.com/TrySound)<br />[💻](https://github.com/ben-eb/postcss-discard-duplicates/commits?author=TrySound) 👀 [⚠️](https://github.com/ben-eb/postcss-discard-duplicates/commits?author=TrySound) | [<img src="https://avatars.githubusercontent.com/u/68302?v=3" width="100px;"/><br /><sub>Lee Houghton</sub>](https://github.com/asztal)<br />[💻](https://github.com/ben-eb/postcss-discard-duplicates/commits?author=asztal) |
| :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors] specification. Contributions of
any kind welcome!
## License
MIT © Ben Briggs
MIT © [Ben Briggs](http://beneb.info)
[all-contributors]: https://github.com/kentcdodds/all-contributors
[ci]: https://travis-ci.org/ben-eb/postcss-discard-duplicates

@@ -70,0 +79,0 @@ [deps]: https://gemnasium.com/ben-eb/postcss-discard-duplicates

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