docs: function set(path, value, collection) {
    const cleanPath = getPath(path);
  
    if (isEmpty(cleanPath)) {
      return collection;
    }
  
    let destination = isArray(collection) ? [...collection] : {...collection};
  
    if (cleanPath.length === 1) {
      destination[cleanPath[0]] = value;
  
      return destination;
    }
  
    const childPath = cleanPath[0];
    const childSource = collection[childPath];
    const descentantSource =
      isArray(childSource) || isObject(childSource) ? childSource : isNumber(cleanPath[1]) ? [] : {};
  
    destination[childPath] = set(cleanPath.slice(1), value, descentantSource);
  
    return destination;
  }