Skip to content

Commit

Permalink
Refactor _getValName
Browse files Browse the repository at this point in the history
  • Loading branch information
L0stSoul authored and tonyganch committed Jun 9, 2014
1 parent 0f64b1c commit 8fbb92c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/options/vendor-prefix-align.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,22 @@ module.exports = {
* returns string: '-webkit-transform', and
* for: 'background: -webkit-linear-gradient(...)'
* returns string: '-webkit-linear-gradient'
* @param {node} node
* @param {node} nodes
* @returns {String|undefined}
*/
_getValName: function(node) {
// TODO: Check that `node[3]` is the node we need
if (node[0] !== 'declaration' || !node[3])
_getValName: function(nodes) {
// TODO: Check that `nodes[3]` is the node we need
if (nodes[0] !== 'declaration' || !nodes[3])
return;

node = node[3].filter(function(item) {
return Array.isArray(item) && item[0] === 'ident' || item[0] === 'function';
})[0];
for (var i = 0; i < nodes[3].length; ++i) {
var node = nodes[3][i];
if (node && node[0] === 'ident')
return node[1];
if (node && node[0] === 'function')
return node[1][1];
}

if (node && node[0] === 'ident')
return node[1];
if (node && node[0] === 'function')
return node[1][1];
},

/**
Expand Down

0 comments on commit 8fbb92c

Please sign in to comment.