lib/serialize.js
function serialize(value) {
  if (Array.isArray(value) === true) {
    return serializeArray(value);
  }
  if (isObject(value) === false) {
    return serializePrimitive(value);
  }
  return serializeObject(value);
}
function serialize(value) {
  if (Array.isArray(value) === true) {
    return serializeArray(value);
  }
  if (isObject(value) === false) {
    return serializePrimitive(value);
  }
  return serializeObject(value);
}
function serialize ( value ) { if ( Array . isArray ( value ) === true ) { return serializeArray ( value ) ; } if ( isObject ( value ) === false ) { return serializePrimitive ( value ) ; } return serializeObject ( value ) ; }
Format values with extra extended json type data.

@param {Any} value - What to wrap as a `{$<type>: <encoded>}` object.
@return {Any}
@api private
Format values with extra extended json type data .