postcss-modules-values-replace
Advanced tools
Comparing version 2.0.0 to 2.0.2
19
index.js
@@ -5,3 +5,3 @@ const postcss = require('postcss'); | ||
const { CachedInputFileSystem, NodeJsInputFileSystem, ResolverFactory } = require('enhanced-resolve'); | ||
const { replaceValueSymbols } = require('icss-utils'); | ||
const valueParser = require('postcss-value-parser'); | ||
@@ -20,2 +20,19 @@ const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/; | ||
const replaceValueSymbols = (valueString, replacements) => { | ||
const value = valueParser(valueString); | ||
value.walk((node) => { | ||
if (node.type !== 'word') return; | ||
const replacement = replacements[node.value]; | ||
if (replacement != null) { | ||
// eslint-disable-next-line no-param-reassign | ||
node.value = replacement; | ||
} | ||
}); | ||
return value.toString(); | ||
}; | ||
const getDefinition = (atRule, existingDefinitions, requiredDefinitions) => { | ||
@@ -22,0 +39,0 @@ let matches; |
{ | ||
"name": "postcss-modules-values-replace", | ||
"version": "2.0.0", | ||
"version": "2.0.2", | ||
"description": "PostCSS plugin to work around CSS Modules values limitations", | ||
@@ -24,4 +24,4 @@ "keywords": [ | ||
"es6-promisify": "^5.0.0", | ||
"icss-utils": "^3.0.1", | ||
"postcss": "^6.0.1" | ||
"postcss": "^6.0.1", | ||
"postcss-value-parser": "^3.3.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10669
128
0
+ Addedpostcss-value-parser@^3.3.0
+ Addedpostcss-value-parser@3.3.1(transitive)
- Removedicss-utils@^3.0.1
- Removedicss-utils@3.0.1(transitive)