"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.hasMedia = void 0;
var dp = new DOMParser();
/*
 * Check if the string contains at least one media element.
 */

var hasMedia = function hasMedia(s) {
  if (!s) {
    return false;
  }

  var root = dp.parseFromString(s, 'text/html');
  return !!root.body.querySelector('img') || !!root.body.querySelector('video') || !!root.body.querySelector('audio');
};

exports.hasMedia = hasMedia;
//# sourceMappingURL=has-media.js.map