postcss-merge-longhand
Advanced tools
Comparing version 5.1.1 to 5.1.2
{ | ||
"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 && |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
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
57907
1702
1
+ Addedstylehacks@7.0.4(transitive)
- Removedstylehacks@5.1.1(transitive)
Updatedstylehacks@^*