lib/compare.js
function recurseChildOptions(obj, level){
            var child = '',
                len = Object.keys(obj).length,
                ctr = 0,
                prefix;
            level = level || 1;
            for(var prop in obj) {
                if(obj.hasOwnProperty(prop)){
                    var tab = getTabs(level +1, true),
                        val;
                    prefix = ctr > 0 ? ',\n' : '';
                    if(_.isPlainObject(obj[prop])){
                        if(!_.isEmpty(obj[prop])){
                            var subChild = recurseChildOptions(obj[prop], level + 1);
                            if(subChild && subChild.length)
                                child += (tab + prop + ': { \n' + subChild + '\n' + tab + '}');
                        }
                    } else {
                        if(_.isArray(obj[prop])){
                            val = arrayToString(obj[prop]);
                            if(val){
                                tab = ctr === 0 ? getTabs(level) : getTabs(level +1, true);
                                child += (prefix + tab + prop + ': ' + arrayToString(obj[prop]));
                            }
                        } else {
                            var isFunc;
                            val = obj[prop];
                            isFunc = _.isFunction(val);
                            if(_.isString(val)){
                                val = "'" + val.toString() + "'";
                            } else {
                                val = val.toString();
                                if(isFunc)
                                    val = funcToString(val, level);
                            }
                            child += (prefix + tab + prop + ': ' + val);
                        }
                    }
                    ctr +=1;
                }
            }
            return child;
        }
function recurseChildOptions(obj, level){
            var child = '',
                len = Object.keys(obj).length,
                ctr = 0,
                prefix;
            level = level || 1;
            for(var prop in obj) {
                if(obj.hasOwnProperty(prop)){
                    var tab = getTabs(level +1, true),
                        val;
                    prefix = ctr > 0 ? ',\n' : '';
                    if(_.isPlainObject(obj[prop])){
                        if(!_.isEmpty(obj[prop])){
                            var subChild = recurseChildOptions(obj[prop], level + 1);
                            if(subChild && subChild.length)
                                child += (tab + prop + ': { \n' + subChild + '\n' + tab + '}');
                        }
                    } else {
                        if(_.isArray(obj[prop])){
                            val = arrayToString(obj[prop]);
                            if(val){
                                tab = ctr === 0 ? getTabs(level) : getTabs(level +1, true);
                                child += (prefix + tab + prop + ': ' + arrayToString(obj[prop]));
                            }
                        } else {
                            var isFunc;
                            val = obj[prop];
                            isFunc = _.isFunction(val);
                            if(_.isString(val)){
                                val = "'" + val.toString() + "'";
                            } else {
                                val = val.toString();
                                if(isFunc)
                                    val = funcToString(val, level);
                            }
                            child += (prefix + tab + prop + ': ' + val);
                        }
                    }
                    ctr +=1;
                }
            }
            return child;
        }
function recurseChildOptions ( obj , level ) { var child = '' , len = Object . keys ( obj ) . length , ctr = 0 , prefix ; level = level || 1 ; for ( var prop in obj ) { if ( obj . hasOwnProperty ( prop ) ) { var tab = getTabs ( level + 1 , true ) , val ; prefix = ctr > 0 ? ',\n' : '' ; if ( _ . isPlainObject ( obj [ prop ] ) ) { if ( ! _ . isEmpty ( obj [ prop ] ) ) { var subChild = recurseChildOptions ( obj [ prop ] , level + 1 ) ; if ( subChild && subChild . length ) child += ( tab + prop + ': { \n' + subChild + '\n' + tab + '}' ) ; } } else { if ( _ . isArray ( obj [ prop ] ) ) { val = arrayToString ( obj [ prop ] ) ; if ( val ) { tab = ctr === 0 ? getTabs ( level ) : getTabs ( level + 1 , true ) ; child += ( prefix + tab + prop + ': ' + arrayToString ( obj [ prop ] ) ) ; } } else { var isFunc ; val = obj [ prop ] ; isFunc = _ . isFunction ( val ) ; if ( _ . isString ( val ) ) { val = "'" + val . toString ( ) + "'" ; } else { val = val . toString ( ) ; if ( isFunc ) val = funcToString ( val , level ) ; } child += ( prefix + tab + prop + ': ' + val ) ; } } ctr += 1 ; } } return child ; }
Recurse child options concat to string.
@private
@memberof Compare
@param {object} obj - the child object.
@returns {string}
Recurse child options concat to string .