langs.js 579 B

1234567891011121314151617181920
  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. const summary_1 = __importDefault(require("./summary"));
  7. /**
  8. Parse an HTML content into a list of language
  9. @param {string} html
  10. @return {Array}
  11. */
  12. function parseLangs(content) {
  13. const parts = (0, summary_1.default)(content).parts;
  14. if (parts.length > 0) {
  15. return parts[0].articles;
  16. }
  17. return [];
  18. }
  19. exports.default = parseLangs;