{"size": 345, "ext": "js", "max_stars_repo_path": "src/directives/unsafe-html.js", "max_stars_repo_name": "rpivo/lit-html-server", "max_stars_repo_stars_event_min_datetime": "2018-08-29T19:27:38.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-19T07:11:41.000Z", "max_issues_repo_path": "src/directives/unsafe-html.js", "max_issues_repo_name": "rpivo/lit-html-server", "max_issues_repo_issues_event_min_datetime": "2018-09-04T19:27:38.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-13T09:10:00.000Z", "max_forks_repo_path": "src/directives/unsafe-html.js", "max_forks_repo_name": "rpivo/lit-html-server", "max_forks_repo_forks_event_min_datetime": "2019-03-25T22:25:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-22T07:45:35.000Z"}
{"max_stars_count": 275, "max_issues_count": 36, "max_forks_count": 15, "avg_line_length": 28.75, "max_line_length": 77, "alphanum_fraction": 0.6695652174}
import { directive, isNodePart, unsafePrefixString } from '../shared.js';

/**
 * Render "value" without HTML escaping
 */
export const unsafeHTML = directive((value) => (part) => {
  if (!isNodePart(part)) {
    throw Error('The `unsafeHTML` directive can only be used in text nodes');
  }
  part.setValue(`${unsafePrefixString}${value}`);
});
