postcss-normalize-repeat-style 5.1.0 → 5.1.1

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/package.json +2 -3
  2. package/src/index.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-normalize-repeat-style",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Convert two value syntax for repeat-style into one value.",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
@@ -31,6 +31,5 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "postcss": "^8.2.15"
34
- },
35
- "readme": "# [postcss][postcss]-normalize-repeat-style\n\n> Normalize repeat styles with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-normalize-repeat-style) do:\n\n```\nnpm install postcss-normalize-repeat-style --save\n```\n\n## Example\n\n### Input\n\n```css\nh1 {\n background: url(image.jpg) repeat no-repeat\n}\n```\n\n### Output\n\n```css\nh1 {\n background: url(image.jpg) repeat-x\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"
34
+ }
36
35
  }
package/src/index.js CHANGED
@@ -21,6 +21,7 @@ function isCommaNode(node) {
21
21
  return node.type === 'div' && node.value === ',';
22
22
  }
23
23
 
24
+ const variableFunctions = new Set(['var', 'env', 'constant']);
24
25
  /**
25
26
  * @param {valueParser.Node} node
26
27
  * @return {boolean}
@@ -30,7 +31,7 @@ function isVariableFunctionNode(node) {
30
31
  return false;
31
32
  }
32
33
 
33
- return ['var', 'env'].includes(node.value.toLowerCase());
34
+ return variableFunctions.has(node.value.toLowerCase());
34
35
  }
35
36
 
36
37
  /**