postcss-colormin 5.2.3 → 5.2.4

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 +5 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -36,16 +36,15 @@ function walk(parent, callback) {
36
36
  */
37
37
 
38
38
 
39
- function hasTransparentBug(browser) {
40
- return ~['ie 8', 'ie 9'].indexOf(browser);
41
- }
39
+ const browsersWithTransparentBug = new Set(['ie 8', 'ie 9']);
40
+ const mathFunctions = new Set(['calc', 'min', 'max', 'clamp']);
42
41
 
43
42
  function isMathFunctionNode(node) {
44
43
  if (node.type !== 'function') {
45
44
  return false;
46
45
  }
47
46
 
48
- return ['calc', 'min', 'max', 'clamp'].includes(node.value.toLowerCase());
47
+ return mathFunctions.has(node.value.toLowerCase());
49
48
  }
50
49
 
51
50
  function transform(value, options) {
@@ -78,10 +77,10 @@ function transform(value, options) {
78
77
 
79
78
  function addPluginDefaults(options, browsers) {
80
79
  const defaults = {
81
- transparent: browsers.some(hasTransparentBug) === false,
82
80
  // Does the browser support 4 & 8 character hex notation
83
- alphaHex: (0, _caniuseApi.isSupported)('css-rrggbbaa', browsers),
81
+ transparent: browsers.some(b => browsersWithTransparentBug.has(b)) === false,
84
82
  // Does the browser support "transparent" value properly
83
+ alphaHex: (0, _caniuseApi.isSupported)('css-rrggbbaa', browsers),
85
84
  name: true
86
85
  };
87
86
  return { ...defaults,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-colormin",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
4
4
  "description": "Minify colors in your CSS files with PostCSS.",
5
5
  "main": "dist/index.js",
6
6
  "files": [