examples/HTML StarterKit/lib/durandal/js/plugins/serializer.js
function(object, settings) {
            settings = (settings === undefined) ? {} : settings;

            if(system.isString(settings) || system.isNumber(settings)) {
                settings = { space: settings };
            }

            return JSON.stringify(object, settings.replacer || this.replacer, settings.space || this.space);
        }
function(object, settings) {
            settings = (settings === undefined) ? {} : settings;

            if(system.isString(settings) || system.isNumber(settings)) {
                settings = { space: settings };
            }

            return JSON.stringify(object, settings.replacer || this.replacer, settings.space || this.space);
        }
function ( object , settings ) { settings = ( settings === undefined ) ? { } : settings ; if ( system . isString ( settings ) || system . isNumber ( settings ) ) { settings = { space : settings } ; } return JSON . stringify ( object , settings . replacer || this . replacer , settings . space || this . space ) ; }
Serializes the object.
@method serialize
@param {object} object The object to serialize.
@param {object} [settings] Settings can specify a replacer or space to override the serializer defaults.
@return {string} The JSON string.
Serializes the object .