Serializes a userData.

@param {THREE.Object3D|THREE.Material} object
@returns {Object}
328530
function serializeUserData(object) {
      try {
        return JSON.parse(JSON.stringify(object.userData));
      } catch (error) {
        console.warn(
          "THREE.GLTFExporter: userData of '" +
            object.name +
            "' " +
            "won't be serialized because of JSON.stringify error - " +
            error.message
        );

        return {};
      }
    }
194941
function serialize(){
    var serialized = {
      nodes: nodes().map(function (id){
        return { id: id };
      }),
      links: []
    };

    serialized.nodes.forEach(function (node){
      var source = node.id;
      adjacent(source).forEach(function (target){
        serialized.links.push({
          source: source,
          target: target,
          weight: getEdgeWeight(source, target)
        });
      });
    });

    return serialized;
  }
1182540
public static byte[] serialize(Object obj) throws IOException {
    if (obj == null) {
      return null;
    }
    try (ByteArrayOutputStream b = new ByteArrayOutputStream()) {
      try (ObjectOutputStream o = new ObjectOutputStream(b)) {
        o.writeObject(obj);
      }
      return b.toByteArray();
    }
  }
1336205
function serialiseRequest (request, toObject) {
  if (!(request instanceof Request)) {
    throw new Error('Expecting request to be instance of Request')
  }

  var headers = []
  var headerNames = request.headers.keys()
  for (var i = 0; i < headerNames.length; i++) {
    var headerName = headerNames[i]
    headers[headerName] = request.headers.get(headerName)
  }

  var serialised = {
    method: request.method,
    url: request.url,
    headers: headers,
    context: request.context,
    referrer: request.referrer,
    mode: request.mode,
    credentials: request.credentials,
    redirect: request.redirect,
    integrity: request.integrity,
    cache: request.cache,
    bodyUsed: request.bodyUsed
  }

  return request
    .blob()
    .then(blobUtil.blobToBase64String)
    .then(function (base64) {
      serialised.__body = base64
      return toObject
        ? serialised
        : JSON.stringify(serialised)
    })
}
86193
function __serializeArray(data, options=DEFAULT_OPTIONS) {
	let dataBuffers = [];
	// ignore undefined value
	for (let key in data) {
		let subData = data[key];
		let subType = __getType(subData, options);
		let subTypeBuffer = __serializeType(subType);
		let subDataBuffers = __serializeData(subType, subData, options);
		dataBuffers.push(subTypeBuffer, ...subDataBuffers);
	}
	let length = __getLengthByArrayBuffers(dataBuffers);
	let lengthData = new Uint32Array([length]);
	return [lengthData.buffer, ...dataBuffers];
}
1098782
function (obj) {
        var formData = new FormData();
        _.forOwn(obj, function (value, key) {
            _.isArray(value) ? _.forEach(value, function (eachValue) {
                formData.append(key, eachValue)
            }) : formData.append(key, value);
        });
        return {
            body: formData
        };
    }
1299817
public String serialize(Object object) throws ConverterException {
	deep = 0;
	StringBuilder sb = new StringBuilder();
	_serialize(object, sb, new HashSet<Object>());
	return sb.toString();
    }
1049320
function getObjectMaterial( object ) {

		return object.material instanceof THREE.MeshFaceMaterial
			? object.material.materials[ 0 ]
			: object.material;

	}
767272
function serialize(value) {
  if (Array.isArray(value) === true) {
    return serializeArray(value);
  }
  if (isObject(value) === false) {
    return serializePrimitive(value);
  }
  return serializeObject(value);
}
522519
function serializeObject(obj) {
  var seen = [];

  return JSON.stringify(obj, function(key, val) {
    val = toJsonReplacer(key, val);
    if (isObject(val)) {

      if (seen.indexOf(val) >= 0) return '...';

      seen.push(val);
    }
    return val;
  });
}
296583
function updateUserDataField(userId, data, overwrite, callback) {
        return _updateUserObjectField(userId, ['data'], data, overwrite)
            .then(function (userData) {
                return userData.data;
            })
            .nodeify(callback);
    }
375361
function serialize(iterable, options = {}) {
  if (!(isArray(iterable) || isPlainObject(iterable))) {
    throw new TypeError("Expected object or array as the first argument.")
  }

  if (isBoolean(options)) {
    options = {strict: options}
  } else if (isString(options) && options) {
    options = {root: options}
  }

  if (!isPlainObject(options)) {
    throw new TypeError(
      "The second argument can be an object, boolean or string value."
    )
  }

  options = assign({}, defaults, options)

  // Choose the serialization method for browsers which
  // are support FormData API partially
  // See: https://caniuse.com/#search=formdata
  const method = isFunction(FormData.prototype.set) ? "set" : "append"

  const fd = new FormData()

  /**
   * Set object fields to FormData instance
   *
   * @param {string} [prefix = undefined] – parent field key
   * @param {any} value – A value of the current field
   *
   * @api private
   */
  function set(prefix, value) {
    for (const key of keys(value)) {
      const name = prefix ? `${prefix}[${key}]` : key
      const field = value[key]

      if (isArray(field) || isPlainObject(field)) {
        set(name, field)
      } else {
        if (options.strict && (isBoolean(field) && field === false)) {
          continue
        }

        fd[method](name, field)
      }
    }
  }

  set(options.root, iterable)

  return fd
}
1023914
function __serializeObjectStreaming(data, options=DEFAULT_OPTIONS) {
	let dataBuffers = [];
	let allKeys = (options.sort_key === true) ? Object.keys(data).sort() : Object.keys(data);
	// ignore undefined value
	for (let key of allKeys) {
		let subData = data[key];
		if (subData === undefined) continue;

		let subType = __getType(subData, options);
		let subTypeBuffer = __serializeType(subType);
		let keyBuffers = __serializeShortString(key);
		let subDataBuffers = __serializeData(subType, subData, options);
		dataBuffers.push(subTypeBuffer, ...keyBuffers, ...subDataBuffers);
	}
	return [...dataBuffers, TYPE_HEADER.OBJECT_END];
}
1010219
def encode(object)
      if MultiJson.respond_to?(:dump)
        # MultiJson >= 1.3
        MultiJson.dump(object)
      elsif MultiJson.respond_to?(:encode)
        # MultiJson < 1.3
        MultiJson.encode(object)
      end
    end
1261585
public static byte[] serialize(Object obj) {
        try(ByteArrayOutputStream bos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(bos)) {
            oos.writeObject(obj);
            return bos.toByteArray();
        } 
        catch (IOException ex) {
            throw new UncheckedIOException(ex);
        }
    }
418188
public static byte[] objectToBytes(Object object) throws IOException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream os = new ObjectOutputStream(baos);
    os.writeObject(object);
    return baos.toByteArray();
  }
1337204
function objectToMap ( obj ) {
	const length = Object.keys(obj).length;
	const data = new types.Map(length);
	let i = 0;
	for ( let prop in obj ) {
		if ( obj.hasOwnProperty(prop) ) {
			data.setKey(i, setJsonValueToSassValue(prop));
			data.setValue(i, setJsonValueToSassValue(obj[prop]));
			i++;
		}
	}
	return data;
}