Method: serialize.object
Transform an object into a JSON string.

Parameters:
object - {Object} The object to be serialized.

Returns:
{String} A JSON string representing the object.
3122
function(object) {
            // three special objects that we want to treat differently
            if(object == null) {
                return "null";
            }
            if(object.constructor == Date) {
                return this.serialize.date.apply(this, [object]);
            }
            if(object.constructor == Array) {
                return this.serialize.array.apply(this, [object]);
            }
            var pieces = ['{'];
            this.level += 1;
            var key, keyJSON, valueJSON;
            
            var addComma = false;
            for(key in object) {
                if(object.hasOwnProperty(key)) {
                    // recursive calls need to allow for sub-classing
                    keyJSON = OpenLayers.Format.JSON.prototype.write.apply(this,
                                                    [key, this.pretty]);
                    valueJSON = OpenLayers.Format.JSON.prototype.write.apply(this,
                                                    [object[key], this.pretty]);
                    if(keyJSON != null && valueJSON != null) {
                        if(addComma) {
                            pieces.push(',');
                        }
                        pieces.push(this.writeNewline(), this.writeIndent(),
                                    keyJSON, ':', this.writeSpace(), valueJSON);
                        addComma = true;
                    }
                }
            }
            
            this.level -= 1;
            pieces.push(this.writeNewline(), this.writeIndent(), '}');
            return pieces.join('');
        }
643954
def serialize(self, data):
        
        if data is None:
            return None
        elif isinstance(data, dict):
            return serializer.Serializer().serialize(data)
        else:
            raise Exception(_("Unable to serialize object of type = '%s'") %
                            type(data))
652703
def serialize(obj, **options):
    '''
    
    '''

    try:
        if 'fp' in options:
            return salt.utils.json.dump(obj, _json_module=_json, **options)
        else:
            return salt.utils.json.dumps(obj, _json_module=_json, **options)
    except Exception as error:
        raise SerializationError(error)
884574
public static String serialize(Object object) {
	if (object == null) return "[null]";
	try {
	    return new ScriptConverter().serialize(object);
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	    return object.toString();
	}
    }
772849
def obj_to_string(obj, top=True):
    
    obj = prepare_for_json_encoding(obj)
    if type(obj) == six.text_type:
        return obj
    return json.dumps(obj)
1064709
def _serialize(self, value, key, obj):
        
        param_values = {}
        for name, attr_tpl in iteritems(self.params):
            attr_name = _tpl(str(attr_tpl))
            if attr_name:
                attribute_value = _get_value(obj, attr_name, default=missing)
                if attribute_value is None:
                    return None
                if attribute_value is not missing:
                    param_values[name] = attribute_value
                else:
                    raise AttributeError(
                        "{attr_name!r} is not a valid "
                        "attribute of {obj!r}".format(attr_name=attr_name, obj=obj)
                    )
            else:
                param_values[name] = attr_tpl
        return url_for(self.endpoint, **param_values)
839764
def serialize_to_json(data, **kwargs):
    
    kwargs['cls'] = kwargs.get('cls', LazyJSONEncoder)

    return json.dumps(data, **kwargs)
121654
public String serialize(Object object) {
		XStream xstream = new XStream();
		return xstream.toXML(object);
	}
347412
function convert(obj) {
  var type = typeof obj;
  if (type === 'object' && Array.isArray(obj)) {
    return '[' + obj.map(convert) + ']';
  }

  if (obj && type === 'object') {
    var string = [];
    for (var i in obj) {
      var prop = i;
      if (prop.indexOf('-') !== -1) prop = "'" + prop + "'";
      string.push(prop + ':' + convert(obj[i]));
    }
    return '{' + string + '}';
  }

  if (type === 'function') {
    return obj.toString();
  }

  return JSON.stringify(obj);
}
254712
def object_to_json(obj, indent=2):
    
    instance_json = json.dumps(obj, indent=indent, ensure_ascii=False, cls=DjangoJSONEncoder)
    return instance_json
1013328
function stringify(obj) {
  if (!isObject(obj)) {
    throw new Error('`Stringify`\'s first argument should be an object')
  }

  var meta = Object.keys(obj)
    .map(function (key) {
      return getLine(key, obj[key])
    }).join('')

  return '// ==UserScript==\n' + meta + '// ==/UserScript==\n'
}
607778
function objectToString(o) {
  return '{' + keys(o).map(k => `${k}: ${o[k]}`).join(', ') + '}';
}
243460
def to_json(object, use_alias = false)
      hash = to_hash(object, use_alias)
      JSON.dump(hash)
    end
776193
def to_json(self, *args, **kwargs):
        """"""
        return json.dumps(self.serialize(), *args, **kwargs)
851875
def json_encode(obj: Instance, **kwargs) -> str:
    
    return json.dumps(obj, cls=JsonClassEncoder, **kwargs)
1328387
def to_json(self, *args, **kwargs):
        
        return json.dumps(self.serialized, *args, **kwargs)
1183575
function stringify(obj) {
  return Object.keys(obj || {})
    .reduce(function(str, prop){
      return str += ''
        + (str ? ' ' : '')
        + prop
        + ': '
        + obj[prop]
        + ';';
    }, '');
}