{"size": 618, "ext": "js", "max_stars_repo_path": "src/modules/views/fragments.js", "max_stars_repo_name": "SotoArmando/odin-todolist", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/modules/views/fragments.js", "max_issues_repo_name": "SotoArmando/odin-todolist", "max_issues_repo_issues_event_min_datetime": "2019-10-11T18:09:03.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T18:50:39.000Z", "max_forks_repo_path": "src/modules/views/fragments.js", "max_forks_repo_name": "SotoArmando/odin-todolist", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 6, "max_forks_count": null, "avg_line_length": 29.4285714286, "max_line_length": 70, "alphanum_fraction": 0.6747572816}
const createFragment = (props = {}) => {
  const {
    classNames = '', element = 'div', html = '', otherAttributes = [],
  } = props;
  const documentFragment = document.createDocumentFragment();
  const newElement = document.createElement(element);
  if (classNames.length > 0) {
    newElement.classList.add(...classNames.split(' '));
  }
  newElement.innerHTML = html;
  if (otherAttributes.length) {
    otherAttributes.forEach(({ name, value }) => {
      newElement.setAttribute(name, value);
    });
  }
  documentFragment.appendChild(newElement);
  return documentFragment;
};

export default createFragment;
