playable
Version:
Video player based on HTML5Video
15 lines • 508 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function htmlToElement(html) {
if (!html) {
throw new Error('HTML provided to htmlToElement is empty');
}
var div = document.createElement('div');
div.innerHTML = html.trim();
if (div.childElementCount > 1) {
throw new Error("HTML provided to htmlToElement doesn't have root element");
}
return div.firstChild;
}
exports.default = htmlToElement;
//# sourceMappingURL=htmlToElement.js.map