Skip to content

Commit

Permalink
Updated code style
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewblond committed Nov 8, 2014
1 parent 3261cdd commit 3ef8dbd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
1 change: 0 additions & 1 deletion .jshintrc
@@ -1,6 +1,5 @@
{
"bitwise": true,
"curly": true,
"eqeqeq": true,
"es3": true,
"forin": true,
Expand Down
24 changes: 6 additions & 18 deletions lib/bem-naming.js
Expand Up @@ -56,28 +56,18 @@ BEMNaming.prototype.typeOf = function (obj) {
obj = this.parse(obj);
}

if (!obj || !obj.block) { return; }
if (!obj || !obj.block) return;

var hasModVal = obj.hasOwnProperty('modVal'),
isMod = obj.modName && (!hasModVal || obj.modVal);

if (obj.elem) {
if (isMod) {
return TYPES.ELEM_MOD;
}

if (!hasModVal) {
return TYPES.ELEM;
}
if (isMod) return TYPES.ELEM_MOD;
if (!hasModVal) return TYPES.ELEM;
}

if (isMod) {
return TYPES.BLOCK_MOD;
}

if (!hasModVal) {
return TYPES.BLOCK;
}
if (isMod) return TYPES.BLOCK_MOD;
if (!hasModVal) return TYPES.BLOCK;
};

/**
Expand Down Expand Up @@ -129,9 +119,7 @@ BEMNaming.prototype.isElemMod = function (obj) {
BEMNaming.prototype.parse = function (str) {
var executed = this._regex.exec(str);

if (!executed) {
return undefined;
}
if (!executed) return;

var elem = executed[5],
modName = executed[2] || executed[6],
Expand Down
1 change: 0 additions & 1 deletion test/.jshintrc
@@ -1,6 +1,5 @@
{
"bitwise": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
Expand Down

0 comments on commit 3ef8dbd

Please sign in to comment.