lib/compare.js
function attributesToString(obj, prevObj, level) {
            var attrs = '',
                prefix,
                tab;
            level = level || 1;
            tab = getTabs(level, true);
            _.forEach(obj, function (v, k) {
                if(excludeAttrs.indexOf(k) === -1){
                    var prev = prevObj && prevObj[k] !== undefined ? prevObj[k] : undefined;
                    prefix = attrs.length ? ',\n' : '';
                    if(_.isPlainObject(v)){
                        var subAttr = attributesToString(v, prev, level +1);
                        if(subAttr && subAttr.length)
                            attrs += (prefix + tab + k + ': {\n' + subAttr + '\n' + tab + '}');
                    } else {
                        if(prev !== v){
                            var val = k === 'type' ? 'types.' + v : v;
                            if(_.isArray(val))
                                val = arrayToString(val);
                            if(_.isFunction(val)){
                                val = funcToString(val.toString(), 2);
                            }
                            attrs += (prefix + tab + k + ': ' + val);
                        }
                    }
                }
            });

            return attrs;
        }
function attributesToString(obj, prevObj, level) {
            var attrs = '',
                prefix,
                tab;
            level = level || 1;
            tab = getTabs(level, true);
            _.forEach(obj, function (v, k) {
                if(excludeAttrs.indexOf(k) === -1){
                    var prev = prevObj && prevObj[k] !== undefined ? prevObj[k] : undefined;
                    prefix = attrs.length ? ',\n' : '';
                    if(_.isPlainObject(v)){
                        var subAttr = attributesToString(v, prev, level +1);
                        if(subAttr && subAttr.length)
                            attrs += (prefix + tab + k + ': {\n' + subAttr + '\n' + tab + '}');
                    } else {
                        if(prev !== v){
                            var val = k === 'type' ? 'types.' + v : v;
                            if(_.isArray(val))
                                val = arrayToString(val);
                            if(_.isFunction(val)){
                                val = funcToString(val.toString(), 2);
                            }
                            attrs += (prefix + tab + k + ': ' + val);
                        }
                    }
                }
            });

            return attrs;
        }
function attributesToString ( obj , prevObj , level ) { var attrs = '' , prefix , tab ; level = level || 1 ; tab = getTabs ( level , true ) ; _ . forEach ( obj , function ( v , k ) { if ( excludeAttrs . indexOf ( k ) === - 1 ) { var prev = prevObj && prevObj [ k ] !== undefined ? prevObj [ k ] : undefined ; prefix = attrs . length ? ',\n' : '' ; if ( _ . isPlainObject ( v ) ) { var subAttr = attributesToString ( v , prev , level + 1 ) ; if ( subAttr && subAttr . length ) attrs += ( prefix + tab + k + ': {\n' + subAttr + '\n' + tab + '}' ) ; } else { if ( prev !== v ) { var val = k === 'type' ? 'types.' + v : v ; if ( _ . isArray ( val ) ) val = arrayToString ( val ) ; if ( _ . isFunction ( val ) ) { val = funcToString ( val . toString ( ) , 2 ) ; } attrs += ( prefix + tab + k + ': ' + val ) ; } } } } ) ; return attrs ; }
Converts a property's atttributes to string.
@private
@memberof Compare
@param {object} obj - the object of attributes.
@param {object} prevObj - the previous object of attributes from last snapshot.
@returns {string}
Converts a property s atttributes to string .