{"size": 319, "ext": "js", "max_stars_repo_path": "libraries/common/helpers/html/decodeHTML.js", "max_stars_repo_name": "fossabot/pwa", "max_stars_repo_stars_event_min_datetime": "2018-03-07T20:08:18.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-01T10:12:27.000Z", "max_issues_repo_path": "libraries/common/helpers/html/decodeHTML.js", "max_issues_repo_name": "fossabot/pwa", "max_issues_repo_issues_event_min_datetime": "2018-04-18T10:35:12.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-14T07:41:23.000Z", "max_forks_repo_path": "libraries/common/helpers/html/decodeHTML.js", "max_forks_repo_name": "fossabot/pwa", "max_forks_repo_forks_event_min_datetime": "2018-05-15T12:53:47.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-21T06:30:04.000Z"}
{"max_stars_count": 35, "max_issues_count": 435, "max_forks_count": 10, "avg_line_length": 21.2666666667, "max_line_length": 68, "alphanum_fraction": 0.6645768025}
/**
 * Unescape HTML entities.
 * @param {string} input The escaped HTML.
 * @returns {string} The unescaped HTML.
 */
const decodeHTML = (input) => {
  const e = document.createElement('div');

  e.innerHTML = input;

  return e.childNodes.length === 0 ? '' : e.childNodes[0].nodeValue;
};

export default decodeHTML;
