lib/facade.js
function Facade(obj, opts) {
  opts = opts || {};
  if (!('clone' in opts)) opts.clone = true;
  if (opts.clone) obj = clone(obj);
  if (!('traverse' in opts)) opts.traverse = true;
  if (!('timestamp' in obj)) obj.timestamp = new Date();
  else obj.timestamp = newDate(obj.timestamp);
  if (opts.traverse) traverse(obj);
  this.opts = opts;
  this.obj = obj;
}
function Facade(obj, opts) {
  opts = opts || {};
  if (!('clone' in opts)) opts.clone = true;
  if (opts.clone) obj = clone(obj);
  if (!('traverse' in opts)) opts.traverse = true;
  if (!('timestamp' in obj)) obj.timestamp = new Date();
  else obj.timestamp = newDate(obj.timestamp);
  if (opts.traverse) traverse(obj);
  this.opts = opts;
  this.obj = obj;
}
A *Facade* is an object meant for creating convience wrappers around
objects. When developing integrations, you probably want to look at its
subclasses, such as {@link Track} or {@link Identify}, rather than this
general-purpose class.

This constructor will initialize a new `Facade` with an `obj` of arguments.

If the inputted `obj` doesn't have a `timestamp` property, one will be added
with the value `new Date()`. Otherwise, the `timestamp` property will be
converted to a Date using the `new-date` package.

By default, the inputted object will be defensively copied, and all ISO
strings present in the string will be converted into Dates.

@param {Object} obj - The object to wrap.
@param {Object} opts - Options about what kind of Facade to create.
@param {boolean} [opts.clone=true] - Whether to make defensive clones. If enabled,
the inputted object will be cloned, and any objects derived from this facade
will be cloned before being returned.
@param {boolean} [opts.traverse=true] - Whether to perform ISODate-Traverse
on the inputted object.

@see {@link https://github.com/segmentio/new-date|new-date}
@see {@link https://github.com/segmentio/isodate-traverse|isodate-traverse}