function recursiveUnset(path, obj, isRecursiveCall = false) {
  if (!path) {
    return obj
  }

  if (size(get(obj, path)) > 0 && isRecursiveCall) {
    return obj
  }
  // The object does not have any other properties at this level.  Remove the
  // property.
  const objectWithRemovedKey = unset(path, obj)
  const newPath = path.match(/\./) ? path.replace(/\.[^.]*$/, '') : ''
  return recursiveUnset(newPath, objectWithRemovedKey, true)
}
Recursively unset a property starting at the deep path, and unsetting the parent
property if there are no other enumerable properties at that level.
@param {string} path - Deep dot path of the property to unset
@param {object} obj - Object from which path should be recursivley unset
@param {boolean} [isRecursiveCall=false] - Used internally to ensure that
the object size check is only performed after one iteration.
@returns {object} The object with the property deeply unset
@private