code: function serialize(value) {
    if (Array.isArray(value) === true) {
      return serializeArray(value);
    }
    if (isObject(value) === false) {
      return serializePrimitive(value);
    }
    return serializeObject(value);
  }
docs: Format values with extra extended json type data.
  
  @param {Any} value - What to wrap as a `{$<type>: <encoded>}` object.
  @return {Any}
  @api private