index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.root = exports.parseHTML = exports.merge = exports.contains = void 0;
  4. var tslib_1 = require("tslib");
  5. /**
  6. * Types used in signatures of Cheerio methods.
  7. *
  8. * @category Cheerio
  9. */
  10. tslib_1.__exportStar(require("./types"), exports);
  11. tslib_1.__exportStar(require("./load"), exports);
  12. var load_1 = require("./load");
  13. /**
  14. * The default cheerio instance.
  15. *
  16. * @deprecated Use the function returned by `load` instead.
  17. */
  18. exports.default = load_1.load([]);
  19. var staticMethods = tslib_1.__importStar(require("./static"));
  20. /**
  21. * In order to promote consistency with the jQuery library, users are encouraged
  22. * to instead use the static method of the same name.
  23. *
  24. * @deprecated
  25. * @example
  26. *
  27. * ```js
  28. * const $ = cheerio.load('<div><p></p></div>');
  29. *
  30. * $.contains($('div').get(0), $('p').get(0));
  31. * //=> true
  32. *
  33. * $.contains($('p').get(0), $('div').get(0));
  34. * //=> false
  35. * ```
  36. *
  37. * @returns {boolean}
  38. */
  39. exports.contains = staticMethods.contains;
  40. /**
  41. * In order to promote consistency with the jQuery library, users are encouraged
  42. * to instead use the static method of the same name.
  43. *
  44. * @deprecated
  45. * @example
  46. *
  47. * ```js
  48. * const $ = cheerio.load('');
  49. *
  50. * $.merge([1, 2], [3, 4]);
  51. * //=> [1, 2, 3, 4]
  52. * ```
  53. */
  54. exports.merge = staticMethods.merge;
  55. /**
  56. * In order to promote consistency with the jQuery library, users are encouraged
  57. * to instead use the static method of the same name as it is defined on the
  58. * "loaded" Cheerio factory function.
  59. *
  60. * @deprecated See {@link static/parseHTML}.
  61. * @example
  62. *
  63. * ```js
  64. * const $ = cheerio.load('');
  65. * $.parseHTML('<b>markup</b>');
  66. * ```
  67. */
  68. exports.parseHTML = staticMethods.parseHTML;
  69. /**
  70. * Users seeking to access the top-level element of a parsed document should
  71. * instead use the `root` static method of a "loaded" Cheerio function.
  72. *
  73. * @deprecated
  74. * @example
  75. *
  76. * ```js
  77. * const $ = cheerio.load('');
  78. * $.root();
  79. * ```
  80. */
  81. exports.root = staticMethods.root;