postcss-normalize-repeat-style
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -10,4 +10,2 @@ "use strict"; | ||
var _cssnanoUtils = require("cssnano-utils"); | ||
var _map = _interopRequireDefault(require("./lib/map")); | ||
@@ -21,6 +19,4 @@ | ||
const repeatKeywords = _map.default.map(mapping => mapping[0]); | ||
const repeatKeywords = [..._map.default.values()]; | ||
const getMatch = (0, _cssnanoUtils.getMatch)(_map.default); | ||
function isCommaNode(node) { | ||
@@ -112,4 +108,6 @@ return node.type === 'div' && node.value === ','; | ||
const match = getMatch(nodes.filter(evenValues).map(n => n.value.toLowerCase())); | ||
const key = nodes.filter(evenValues).map(n => n.value.toLowerCase()).toString(); | ||
const match = _map.default.get(key); | ||
if (match) { | ||
@@ -128,3 +126,3 @@ nodes[0].value = match; | ||
prepare() { | ||
const cache = {}; | ||
const cache = new Map(); | ||
return { | ||
@@ -139,4 +137,4 @@ OnceExit(css) { | ||
if (cache[value]) { | ||
decl.value = cache[value]; | ||
if (cache.has(value)) { | ||
decl.value = cache.get(value); | ||
return; | ||
@@ -147,3 +145,3 @@ } | ||
decl.value = result; | ||
cache[value] = result; | ||
cache.set(value, result); | ||
}); | ||
@@ -150,0 +148,0 @@ } |
@@ -7,4 +7,6 @@ "use strict"; | ||
exports.default = void 0; | ||
var _default = [['repeat-x', ['repeat', 'no-repeat']], ['repeat-y', ['no-repeat', 'repeat']], ['repeat', ['repeat', 'repeat']], ['space', ['space', 'space']], ['round', ['round', 'round']], ['no-repeat', ['no-repeat', 'no-repeat']]]; | ||
var _default = new Map([[['repeat', 'no-repeat'].toString(), 'repeat-x'], [['no-repeat', 'repeat'].toString(), 'repeat-y'], [['repeat', 'repeat'].toString(), 'repeat'], [['space', 'space'].toString(), 'space'], [['round', 'round'].toString(), 'round'], [['no-repeat', 'no-repeat'].toString(), 'no-repeat']]); | ||
exports.default = _default; | ||
module.exports = exports.default; |
{ | ||
"name": "postcss-normalize-repeat-style", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Convert two value syntax for repeat-style into one value.", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prebuild": "del-cli dist", | ||
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"", | ||
"prepublish": "yarn build" | ||
}, | ||
"files": [ | ||
@@ -17,4 +12,3 @@ "LICENSE-MIT", | ||
"dependencies": { | ||
"cssnano-utils": "^2.0.1", | ||
"postcss-value-parser": "^4.1.0" | ||
"postcss-value-parser": "^4.2.0" | ||
}, | ||
@@ -40,3 +34,7 @@ "author": { | ||
}, | ||
"gitHead": "28c247175032fa03f04911cde56ad82d74d211cc" | ||
} | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"" | ||
}, | ||
"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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
7371
5
- Removedcssnano-utils@^2.0.1
- Removedcssnano-utils@2.0.1(transitive)
Updatedpostcss-value-parser@^4.2.0