trimObject = object => {
  if (!_.isObject(object)) return object;
  return _.keys(object).reduce((acc, key) => {
    if (typeof object[key] === 'string') {
      try {
        acc[key.trim()] = JSON.parse(object[key].trim());
      } catch (e) {
        acc[key.trim()] = object[key].trim();
      }
    } else {
      acc[key.trim()] = trimObject(object[key]);
    }
    return acc;
  }, Array.isArray(object) ? [] : {});
}
Given an object, trims every keys and values recursively.
@param {Object} object
@return {Object} trimmedObject