Skip to content

Commit

Permalink
Upgrade postcss-value-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound authored and ben-eb committed Feb 25, 2017
1 parent e8c94d0 commit 46da143
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/postcss-merge-idents/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var postcss = require('postcss');
var parser = require('postcss-value-parser');
var valueParser = require('postcss-value-parser');

function canonical (obj) {
return function recurse (key) {
Expand Down Expand Up @@ -51,16 +51,15 @@ function mergeAtRules (css, pairs) {
pairs.forEach(function (pair) {
var canon = canonical(pair.replacements);
pair.decls.forEach(function (decl) {
decl.value = parser(decl.value).walk(function (node) {
decl.value = valueParser(decl.value).walk(function (node) {
if (node.type === 'word') {
node.value = canon(node.value);
}
if (node.type === 'space') {
node.value = ' ';
}
if (node.type === 'div') {
node.before = '';
node.after = '';
node.before = node.after = '';
}
}).toString();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-merge-idents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"repository": "ben-eb/postcss-merge-idents",
"dependencies": {
"postcss": "^5.0.4",
"postcss-value-parser": "^2.0.4"
"postcss-value-parser": "^3.0.2"
}
}

0 comments on commit 46da143

Please sign in to comment.