Socket
Socket
Sign inDemoInstall

postcss-minify-font-values

Package Overview
Dependencies
5
Maintainers
8
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.4 to 5.1.0

types/index.d.ts

6

package.json
{
"name": "postcss-minify-font-values",
"version": "5.0.4",
"version": "5.1.0",
"description": "Minify font declarations with PostCSS",
"main": "src/index.js",
"types": "types/index.d.ts",
"files": [
"src",
"LICENSE"
"LICENSE",
"types"
],

@@ -10,0 +12,0 @@ "author": "Bogdan Chadkin <trysound@yandex.ru>",

@@ -7,2 +7,6 @@ 'use strict';

/**
* @param {string} value
* @return {boolean}
*/
function hasVariableFunction(value) {

@@ -14,2 +18,8 @@ const lowerCasedValue = value.toLowerCase();

/**
* @param {string} prop
* @param {string} value
* @param {Options} opts
* @return {string}
*/
function transform(prop, value, opts) {

@@ -37,2 +47,9 @@ let lowerCasedProp = prop.toLowerCase();

/** @typedef {{removeAfterKeyword?: boolean, removeDuplicates?: boolean, removeQuotes?: boolean}} Options */
/**
* @type {import('postcss').PluginCreator<Options>}
* @param {Options} opts
* @return {import('postcss').Plugin}
*/
function pluginCreator(opts) {

@@ -39,0 +56,0 @@ opts = Object.assign(

'use strict';
const { stringify } = require('postcss-value-parser');
/**
* @param {string[]} list
* @return {string[]}
*/
function uniqueFontFamilies(list) {

@@ -23,2 +27,7 @@ return list.filter((item, i) => {

/**
* @param {string} value
* @param {number} length
* @return {string[]}
*/
function makeArray(value, length) {

@@ -35,7 +44,12 @@ let array = [];

/**
* @param {string} string
* @param {boolean} escapeForString
* @return {string}
*/
function escape(string, escapeForString) {
let counter = 0;
let character = null;
let charCode = null;
let value = null;
let character;
let charCode;
let value;
let output = '';

@@ -90,5 +104,10 @@

/**
* @param {string} string
* @return {string}
*/
function escapeIdentifierSequence(string) {
let identifiers = string.split(regexWhitespace);
let index = 0;
/** @type {string[] | string} */
let result = [];

@@ -157,5 +176,11 @@ let escapeResult;

}
/**
* @param {import('postcss-value-parser').Node[]} nodes
* @param {import('../index').Options} opts
* @return {import('postcss-value-parser').WordNode[]}
*/
module.exports = function (nodes, opts) {
/** @type {import('postcss-value-parser').Node[]} */
const family = [];
/** @type {import('postcss-value-parser').WordNode | null} */
let last = null;

@@ -169,3 +194,6 @@ let i, max;

if (!last) {
last = { type: 'word', value: '' };
last = /** @type {import('postcss-value-parser').WordNode} */ ({
type: 'word',
value: '',
});
family.push(last);

@@ -220,7 +248,7 @@ }

return [
{
/** @type {import('postcss-value-parser').WordNode} */ ({
type: 'word',
value: normalizedFamilies.join(),
},
}),
];
};

@@ -7,4 +7,10 @@ 'use strict';

/**
* @param {import('postcss-value-parser').Node[]} nodes
* @param {import('../index').Options} opts
* @return {import('postcss-value-parser').Node[]}
*/
module.exports = function (nodes, opts) {
let i, max, node, familyStart, family;
let i, max, node, family;
let familyStart = NaN;
let hasSize = false;

@@ -11,0 +17,0 @@

'use strict';
/**
* @param {string} value
* @return {string}
*/
module.exports = function (value) {

@@ -3,0 +7,0 @@ const lowerCasedValue = value.toLowerCase();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc