lib/express-expose.js
function string(obj) {
  if ('function' === typeof obj) {
    return obj.toString();
  } else if (obj instanceof Date) {
    return 'new Date("' + obj + '")';
  } else if (Array.isArray(obj)) {
    return '[' + obj.map(string).join(', ') + ']';
  } else if ('[object Object]' === Object.prototype.toString.call(obj)) {
    return '{' + Object.keys(obj).map(function(key){
      return '"' + key + '":' + string(obj[key]);
    }).join(', ') + '}';
  } else {
    return JSON.stringify(obj);
  }
}
function string(obj) {
  if ('function' === typeof obj) {
    return obj.toString();
  } else if (obj instanceof Date) {
    return 'new Date("' + obj + '")';
  } else if (Array.isArray(obj)) {
    return '[' + obj.map(string).join(', ') + ']';
  } else if ('[object Object]' === Object.prototype.toString.call(obj)) {
    return '{' + Object.keys(obj).map(function(key){
      return '"' + key + '":' + string(obj[key]);
    }).join(', ') + '}';
  } else {
    return JSON.stringify(obj);
  }
}
function string ( obj ) { if ( 'function' === typeof obj ) { return obj . toString ( ) ; } else if ( obj instanceof Date ) { return 'new Date("' + obj + '")' ; } else if ( Array . isArray ( obj ) ) { return '[' + obj . map ( string ) . join ( ', ' ) + ']' ; } else if ( '[object Object]' === Object . prototype . toString . call ( obj ) ) { return '{' + Object . keys ( obj ) . map ( function ( key ) { return '"' + key + '":' + string ( obj [ key ] ) ; } ) . join ( ', ' ) + '}' ; } else { return JSON . stringify ( obj ) ; } }
Return a string representation of `obj`.

@param {Mixed} obj
@return {String}
@api private
Return a string representation of obj .