-
-
Save eunomie/2406396 to your computer and use it in GitHub Desktop.
inconsistent code style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {*} input to create the G with. | |
* @param {string|Element|Node=} opt_mod elemnt to look under. | |
* @constructor | |
* @return {G} the G object. | |
*/ | |
G = function(input, opt_mod) { | |
if (input.constructor == G) // if with one statement and no {} | |
return /** @type {G} */(input); | |
if (goog.isString(opt_mod)) { // if with one statement but {} | |
opt_mod = G.elsBySelector(/** @type {string} */(opt_mod))[0]; | |
} | |
if (input.nodeType) // if without {} | |
input = [input]; | |
else if (goog.isString(input)) { // but else if with {} | |
if (input.charAt(0) == '<') { | |
input = [goog.dom.htmlToDocumentFragment(input)]; | |
} else { // else and } on the same line | |
input = G.elsBySelector(input, opt_mod); | |
} | |
if (!input) { | |
input = []; | |
} | |
} // but } and else not on the same line | |
else if (!input) { | |
input = []; | |
} | |
if (!goog.isArrayLike(input)) { | |
input = [input]; | |
} | |
return /** @type {G} */(new G.init(/** @type {{length: number}} */(input))); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!goog.isDef(opt_selector)) | |
return true; | |
if (goog.isFunction(opt_selector)) { | |
return opt_selector(element); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment