postcss-unique-selectors 5.0.2 → 5.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +3 -5
  2. package/package.json +8 -9
package/dist/index.js CHANGED
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _alphanumSort = _interopRequireDefault(require("alphanum-sort"));
9
-
10
8
  var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
11
9
 
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -16,9 +14,9 @@ function parseSelectors(selectors, callback) {
16
14
  }
17
15
 
18
16
  function unique(rule) {
19
- rule.selector = (0, _alphanumSort.default)([...new Set(rule.selectors)], {
20
- insensitive: true
21
- }).join();
17
+ const selector = [...new Set(rule.selectors)];
18
+ selector.sort();
19
+ rule.selector = selector.join();
22
20
  }
23
21
 
24
22
  function pluginCreator() {
package/package.json CHANGED
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "postcss-unique-selectors",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "description": "Ensure CSS selectors are unique.",
5
5
  "main": "dist/index.js",
6
- "scripts": {
7
- "prebuild": "rimraf dist",
8
- "build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"",
9
- "prepare": "yarn build"
10
- },
11
6
  "files": [
12
7
  "LICENSE-MIT",
13
8
  "dist"
@@ -26,7 +21,6 @@
26
21
  },
27
22
  "repository": "cssnano/cssnano",
28
23
  "dependencies": {
29
- "alphanum-sort": "^1.0.2",
30
24
  "postcss-selector-parser": "^6.0.5"
31
25
  },
32
26
  "bugs": {
@@ -40,5 +34,10 @@
40
34
  },
41
35
  "peerDependencies": {
42
36
  "postcss": "^8.2.15"
43
- }
44
- }
37
+ },
38
+ "scripts": {
39
+ "prebuild": "rimraf dist",
40
+ "build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\""
41
+ },
42
+ "readme": "# [postcss][postcss]-unique-selectors\n\n> Ensure CSS selectors are unique.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-unique-selectors) do:\n\n```\nnpm install postcss-unique-selectors --save\n```\n\n## Example\n\nSelectors are sorted naturally, and deduplicated:\n\n### Input\n\n```css\nh1,h3,h2,h1 {\n color: red\n}\n```\n\n### Output\n\n```css\nh1,h2,h3 {\n color: red\n}\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n"
43
+ }