🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

postcss-minify-font-values

Package Overview
Dependencies
Maintainers
7
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-minify-font-values - npm Package Compare versions

Comparing version

to
4.0.0-nightly.2020.1.11

52

dist/index.js

@@ -8,4 +8,2 @@ "use strict";

var _postcss = _interopRequireDefault(require("postcss"));
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));

@@ -44,3 +42,3 @@

var _default = _postcss.default.plugin('postcss-minify-font-values', opts => {
function pluginCreator(opts) {
opts = Object.assign({}, {

@@ -51,27 +49,39 @@ removeAfterKeyword: false,

}, opts);
return css => {
const cache = {};
css.walkDecls(/font/i, decl => {
const value = decl.value;
return {
postcssPlugin: 'postcss-minify-font-values',
if (!value) {
return;
}
prepare() {
const cache = {};
return {
OnceExit(css) {
css.walkDecls(/font/i, decl => {
const value = decl.value;
const prop = decl.prop;
const cacheKey = `${prop}|${value}`;
if (!value) {
return;
}
if (cache[cacheKey]) {
decl.value = cache[cacheKey];
return;
}
const prop = decl.prop;
const cacheKey = `${prop}|${value}`;
const newValue = transform(prop, value, opts);
decl.value = newValue;
cache[cacheKey] = newValue;
});
if (cache[cacheKey]) {
decl.value = cache[cacheKey];
return;
}
const newValue = transform(prop, value, opts);
decl.value = newValue;
cache[cacheKey] = newValue;
});
}
};
}
};
});
}
pluginCreator.postcss = true;
var _default = pluginCreator;
exports.default = _default;
module.exports = exports.default;
{
"name": "postcss-minify-font-values",
"version": "4.0.0-nightly.2020.1.9",
"version": "4.0.0-nightly.2020.1.11",
"description": "Minify font declarations with PostCSS",

@@ -20,4 +20,3 @@ "main": "dist/index.js",

"dependencies": {
"postcss": "^7.0.16",
"postcss-value-parser": "^3.3.1"
"postcss-value-parser": "^4.1.0"
},

@@ -36,3 +35,9 @@ "repository": "cssnano/cssnano",

"node": ">=10.13.0"
},
"devDependencies": {
"postcss": "^8.2.1"
},
"peerDependencies": {
"postcss": "^8.2.1"
}
}