valid.js 434 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var html_1 = require("./nodes/html");
  4. /**
  5. * Parses HTML and returns a root element
  6. * Parse a chuck of HTML source.
  7. */
  8. function valid(data, options) {
  9. if (options === void 0) { options = { lowerCaseTagName: false, comment: false }; }
  10. var stack = html_1.base_parse(data, options);
  11. return Boolean(stack.length === 1);
  12. }
  13. exports.default = valid;