slim.js 1.4 KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. exports.load = exports.merge = exports.contains = void 0;
  7. /**
  8. * @file Alternative entry point for Cheerio that always uses htmlparser2. This
  9. * way, parse5 won't be loaded, saving some memory.
  10. */
  11. const load_js_1 = require("./load.js");
  12. const parse_js_1 = require("./parse.js");
  13. const dom_serializer_1 = __importDefault(require("dom-serializer"));
  14. const htmlparser2_1 = require("htmlparser2");
  15. var static_js_1 = require("./static.js");
  16. Object.defineProperty(exports, "contains", { enumerable: true, get: function () { return static_js_1.contains; } });
  17. Object.defineProperty(exports, "merge", { enumerable: true, get: function () { return static_js_1.merge; } });
  18. /**
  19. * Create a querying function, bound to a document created from the provided
  20. * markup.
  21. *
  22. * @param content - Markup to be loaded.
  23. * @param options - Options for the created instance.
  24. * @param isDocument - Always `false` here, as we are always using
  25. * `htmlparser2`.
  26. * @returns The loaded document.
  27. * @see {@link https://cheerio.js.org#loading} for additional usage information.
  28. */
  29. exports.load = (0, load_js_1.getLoad)((0, parse_js_1.getParse)(htmlparser2_1.parseDocument), dom_serializer_1.default);
  30. //# sourceMappingURL=slim.js.map