postcss-merge-rules 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.
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.filterPrefixes = filterPrefixes;
7
6
  exports.sameVendor = sameVendor;
8
7
  exports.noVendor = noVendor;
9
8
  exports.ensureCompatibility = ensureCompatibility;
@@ -13,8 +12,6 @@ var _caniuseApi = require("caniuse-api");
13
12
 
14
13
  var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
15
14
 
16
- var _vendors = _interopRequireDefault(require("vendors"));
17
-
18
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
16
 
20
17
  const simpleSelectorRe = /^#?[-._a-z0-9 ]+$/i;
@@ -25,17 +22,14 @@ const cssFirstLetter = 'css-first-letter';
25
22
  const cssFirstLine = 'css-first-line';
26
23
  const cssInOutOfRange = 'css-in-out-of-range';
27
24
  const formValidation = 'form-validation';
28
- /** @type {string[]} */
29
-
30
- const prefixes = _vendors.default.map(v => `-${v}-`);
25
+ const vendorPrefix = /-(ah|apple|atsc|epub|hp|khtml|moz|ms|o|rim|ro|tc|wap|webkit|xv)-/;
31
26
  /**
32
27
  * @param {string} selector
33
28
  * @return {string[]}
34
29
  */
35
30
 
36
-
37
31
  function filterPrefixes(selector) {
38
- return prefixes.filter(prefix => selector.indexOf(prefix) !== -1);
32
+ return selector.match(vendorPrefix);
39
33
  } // Internet Explorer use :-ms-input-placeholder.
40
34
  // Microsoft Edge use ::-ms-input-placeholder.
41
35
 
@@ -56,7 +50,7 @@ function sameVendor(selectorsA, selectorsB) {
56
50
 
57
51
 
58
52
  function noVendor(selector) {
59
- return !filterPrefixes(selector).length;
53
+ return !vendorPrefix.test(selector);
60
54
  }
61
55
 
62
56
  const pseudoElements = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-merge-rules",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "description": "Merge CSS rules with PostCSS.",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -8,9 +8,9 @@
8
8
  "dist"
9
9
  ],
10
10
  "scripts": {
11
- "prebuild": "del-cli dist",
11
+ "prebuild": "rimraf dist",
12
12
  "build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"",
13
- "prepublish": "yarn build"
13
+ "prepare": "yarn build"
14
14
  },
15
15
  "keywords": [
16
16
  "css",
@@ -30,8 +30,7 @@
30
30
  "browserslist": "^4.16.6",
31
31
  "caniuse-api": "^3.0.0",
32
32
  "cssnano-utils": "^2.0.1",
33
- "postcss-selector-parser": "^6.0.5",
34
- "vendors": "^1.0.3"
33
+ "postcss-selector-parser": "^6.0.5"
35
34
  },
36
35
  "bugs": {
37
36
  "url": "https://github.com/cssnano/cssnano/issues"
@@ -44,6 +43,5 @@
44
43
  },
45
44
  "peerDependencies": {
46
45
  "postcss": "^8.2.15"
47
- },
48
- "gitHead": "9b3c54fd94f3e2bdb503d1e21f171d7fe02f33ca"
46
+ }
49
47
  }