Skip to content

Commit

Permalink
sdsds
Browse files Browse the repository at this point in the history
  • Loading branch information
skad0 committed Jun 1, 2017
1 parent 8b3613e commit 3e9348b
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/normalize/v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ module.exports = function (decl, scope) {
}

// we should return block always if elems or mods given
if (elems || (!isNotActual(mods) && !isArrayOrString(elem))) {
if (elems || !isNotActual(mods) && isNotActual(elem)) {
add({ block: block }, tech);
}

if (block) {
let noOther = !elems && !elem && isNotActual(mods) && isNotActual(mod);

if (noOther) {
if (!elem && isNotActual(mod)) {
add({ block: block }, tech);
}

Expand Down Expand Up @@ -79,6 +77,10 @@ module.exports = function (decl, scope) {
if (modsExists) {
processMods({ block, elem: elemName, mods: elItem.mods, tech });
}

if (!isNotActual(mods)) {
processMods({ block, elem: elemName, mods, tech });
}
}
}
}
Expand Down Expand Up @@ -227,15 +229,6 @@ module.exports = function (decl, scope) {
}
}

/**
* Checks if value of given variable is an array or string
* @param {*} variable - value to check
* @return {Boolean}
*/
function isArrayOrString(variable) {
return Array.isArray(variable) || typeof variable === 'string';
}

function isNotActual(obj) {
return !obj || (typeof obj === 'object' && Object.keys(obj).length === 0);
}
Expand Down

0 comments on commit 3e9348b

Please sign in to comment.