postcss-minify-params 5.0.0-rc.1 → 5.0.2

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.
package/dist/index.js CHANGED
@@ -11,13 +11,11 @@ var _postcssValueParser = _interopRequireWildcard(require("postcss-value-parser"
11
11
 
12
12
  var _alphanumSort = _interopRequireDefault(require("alphanum-sort"));
13
13
 
14
- var _uniqs = _interopRequireDefault(require("uniqs"));
15
-
16
14
  var _cssnanoUtils = require("cssnano-utils");
17
15
 
18
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
17
 
20
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
19
 
22
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
21
 
@@ -43,6 +41,12 @@ function removeNode(node) {
43
41
  node.type = 'word';
44
42
  }
45
43
 
44
+ function sortAndDedupe(items) {
45
+ return (0, _alphanumSort.default)([...new Set(items)], {
46
+ insensitive: true
47
+ }).join();
48
+ }
49
+
46
50
  function transform(legacy, rule) {
47
51
  const ruleName = rule.name.toLowerCase(); // We should re-arrange parameters only for `@media` and `@supports` at-rules
48
52
 
@@ -82,9 +86,7 @@ function transform(legacy, rule) {
82
86
  }
83
87
  }
84
88
  }, true);
85
- rule.params = (0, _alphanumSort.default)((0, _uniqs.default)((0, _cssnanoUtils.getArguments)(params).map(split)), {
86
- insensitive: true
87
- }).join();
89
+ rule.params = sortAndDedupe((0, _cssnanoUtils.getArguments)(params).map(split));
88
90
 
89
91
  if (!rule.params.length) {
90
92
  rule.raws.afterName = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-minify-params",
3
- "version": "5.0.0-rc.1",
3
+ "version": "5.0.2",
4
4
  "description": "Minify at-rule params with PostCSS",
5
5
  "keywords": [
6
6
  "postcss",
@@ -23,24 +23,22 @@
23
23
  "homepage": "https://github.com/cssnano/cssnano",
24
24
  "dependencies": {
25
25
  "alphanum-sort": "^1.0.2",
26
- "browserslist": "^4.16.0",
27
- "cssnano-utils": "^2.0.0-rc.1",
28
- "postcss-value-parser": "^4.1.0",
29
- "uniqs": "^2.0.0"
26
+ "browserslist": "^4.16.6",
27
+ "cssnano-utils": "^2.0.1",
28
+ "postcss-value-parser": "^4.1.0"
30
29
  },
31
30
  "scripts": {
32
- "prebuild": "del-cli dist",
33
- "build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.js --out-dir dist --ignore \"**/__tests__/\"",
34
- "prepublish": "yarn build"
31
+ "prebuild": "rimraf dist",
32
+ "build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"",
33
+ "prepare": "yarn build"
35
34
  },
36
35
  "engines": {
37
36
  "node": "^10 || ^12 || >=14.0"
38
37
  },
39
38
  "devDependencies": {
40
- "postcss": "^8.2.1"
39
+ "postcss": "^8.2.15"
41
40
  },
42
41
  "peerDependencies": {
43
- "postcss": "^8.2.1"
44
- },
45
- "gitHead": "114efb0092fff944dd4c8a28d184add24d8fde3e"
42
+ "postcss": "^8.2.15"
43
+ }
46
44
  }
package/CHANGELOG.md DELETED
@@ -1,54 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [5.0.0-rc.1](https://github.com/cssnano/cssnano/compare/postcss-minify-params@5.0.0-rc.0...postcss-minify-params@5.0.0-rc.1) (2021-03-04)
7
-
8
- **Note:** Version bump only for package postcss-minify-params
9
-
10
-
11
-
12
-
13
-
14
- # 5.0.0-rc.0 (2021-02-19)
15
-
16
-
17
- ### chore
18
-
19
- * minimum require version of node is 10.13 ([#871](https://github.com/cssnano/cssnano/issues/871)) ([28bda24](https://github.com/cssnano/cssnano/commit/28bda243e32ce3ba89b3c358a5f78727b3732f11))
20
-
21
-
22
- ### Features
23
-
24
- * migarete to PostCSS 8 ([#975](https://github.com/cssnano/cssnano/issues/975)) ([40b82dc](https://github.com/cssnano/cssnano/commit/40b82dca7f53ac02cd4fe62846dec79b898ccb49))
25
-
26
-
27
- ### BREAKING CHANGES
28
-
29
- * minimum supported `postcss` version is `8.2.1`
30
- * minimum require version of node is 10.13
31
-
32
-
33
-
34
- ## 4.1.9 (2019-02-12)
35
-
36
-
37
- ### Bug Fixes
38
-
39
- * do not mangle `[@page](https://github.com/page) :first` rules ([#678](https://github.com/cssnano/cssnano/issues/678)) ([69aab0b](https://github.com/cssnano/cssnano/commit/69aab0b527198979e2232a57554cf888ad868231))
40
-
41
-
42
- ### Performance Improvements
43
-
44
- * **postcss-minify-params:** increase perf ([e06a24e](https://github.com/cssnano/cssnano/commit/e06a24e44aae8935290b7bc05d9da51b99367d2b))
45
-
46
-
47
-
48
- ## 4.1.1 (2018-09-24)
49
-
50
-
51
- ### Bug Fixes
52
-
53
- * add `browserslist` to dependencies for `postcss-minify-params` ([#594](https://github.com/cssnano/cssnano/issues/594)) ([9d40806](https://github.com/cssnano/cssnano/commit/9d40806151026dcd2272dc22a76009b27224d512))
54
- * **postcss-merge-longhand:** not mangle border output ([#555](https://github.com/cssnano/cssnano/issues/555)) ([9a70605](https://github.com/cssnano/cssnano/commit/9a706050b621e7795a9bf74eb7110b5c81804ffe)), closes [#553](https://github.com/cssnano/cssnano/issues/553) [#554](https://github.com/cssnano/cssnano/issues/554)