Socket
Socket
Sign inDemoInstall

postcss-merge-longhand

Package Overview
Dependencies
Maintainers
7
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-merge-longhand - npm Package Compare versions

Comparing version 5.1.1 to 5.1.2

4

package.json
{
"name": "postcss-merge-longhand",
"version": "5.1.1",
"version": "5.1.2",
"description": "Merge longhand properties into shorthand with PostCSS.",

@@ -29,3 +29,3 @@ "main": "src/index.js",

"postcss-value-parser": "^4.2.0",
"stylehacks": "^5.1.0"
"stylehacks": "^*"
},

@@ -32,0 +32,0 @@ "bugs": {

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

const varRE = /(^.*var)(.*\(.*--.*\))(.*)/i;
/** @type {(p: RegExpExecArray) => string} */
const varPreserveCase = (p) =>
`${p[1].toLowerCase()}${p[2]}${p[3].toLowerCase()}`;
/* Approximate https://drafts.csswg.org/css-values-4/#typedef-dashed-ident */
// eslint-disable-next-line no-control-regex
const varRE = /--(\w|[^\x00-\x7F])+/g;
/** @type {(v: string) => string} */
const toLower = (v) => {
const match = varRE.exec(v);
return match ? varPreserveCase(match) : v.toLowerCase();
let match;
let lastIndex = 0;
let result = '';
varRE.lastIndex = 0;
while ((match = varRE.exec(v)) !== null) {
if (match.index > lastIndex) {
result += v.substring(lastIndex, match.index).toLowerCase();
}
result += match[0];
lastIndex = match.index + match[0].length;
}
if (lastIndex < v.length) {
result += v.substring(lastIndex).toLowerCase();
}
if (result === '') {
return v;
}
return result;
};

@@ -30,3 +45,2 @@

const values = list.space(value);
if (

@@ -33,0 +47,0 @@ values.length > 1 &&

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc