function deepExtend(target, extension) {
  objectEach(extension, function (value, key) {
    if (extension[key] && (0, _typeof2.default)(extension[key]) === 'object') {
      if (!target[key]) {
        if (Array.isArray(extension[key])) {
          target[key] = [];
        } else if (Object.prototype.toString.call(extension[key]) === '[object Date]') {
          target[key] = extension[key];
        } else {
          target[key] = {};
        }
      }

      deepExtend(target[key], extension[key]);
    } else {
      target[key] = extension[key];
    }
  });
}
Perform deep extend of a target object with extension's own properties.

@param {Object} target An object that will receive the new properties.
@param {Object} extension An object containing additional properties to merge into the target.