Skip to content

Commit

Permalink
Refactor normalize v1
Browse files Browse the repository at this point in the history
  • Loading branch information
skad0 committed Oct 12, 2016
1 parent b1bf7cd commit 949330c
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions lib/normalize/v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,23 @@ module.exports = function (decl) {
for (let i = 0; i < mods.length; ++i) {
const mod = mods[i];
const vals = mod.vals;
const l = vals && vals.length;
const hasVals = vals && vals.length;

let resItem;
let j = 0;

if (l) {
for (let j = 0; j < l; ++j) {
resItem = {
block: block,
modName: mod.name, modVal: vals[j].name
};

isElem && (resItem.elem = elem);

add(resItem);
}
} else {
do {
resItem = {
block: block,
modName: mod.name, modVal: true
modName: mod.name,
modVal: hasVals ? vals[j].name : true
};

isElem && (resItem.elem = elem);

add(resItem);
}
++j;
} while (j < hasVals);
}
}

Expand Down

0 comments on commit 949330c

Please sign in to comment.