@scrabble-solver/word-definitions 2.7.2 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var lib_1 = require("../lib");
4
4
  var crawlEnglish = function (word) {
5
- return lib_1.request({
5
+ return (0, lib_1.request)({
6
6
  protocol: 'https',
7
7
  hostname: 'www.merriam-webster.com',
8
- path: "/dictionary/" + encodeURIComponent(word),
8
+ path: "/dictionary/".concat(encodeURIComponent(word)),
9
9
  });
10
10
  };
11
11
  exports.default = crawlEnglish;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var lib_1 = require("../lib");
4
4
  var crawlFrench = function (word) {
5
- return lib_1.request({
5
+ return (0, lib_1.request)({
6
6
  protocol: 'https',
7
7
  hostname: 'www.cnrtl.fr',
8
- path: "/definition/" + encodeURIComponent(word),
8
+ path: "/definition/".concat(encodeURIComponent(word)),
9
9
  });
10
10
  };
11
11
  exports.default = crawlFrench;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var lib_1 = require("../lib");
4
4
  var crawlGerman = function (word) {
5
- return lib_1.request({
5
+ return (0, lib_1.request)({
6
6
  protocol: 'https',
7
7
  hostname: 'www.dwds.de',
8
- path: "?q=" + encodeURIComponent(word) + "&from=wb",
8
+ path: "?q=".concat(encodeURIComponent(word), "&from=wb"),
9
9
  });
10
10
  };
11
11
  exports.default = crawlGerman;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var lib_1 = require("../lib");
4
4
  var crawlPolish = function (word) {
5
- return lib_1.request({
5
+ return (0, lib_1.request)({
6
6
  protocol: 'https',
7
7
  hostname: 'sjp.pl',
8
- path: "/" + encodeURIComponent(word),
8
+ path: "/".concat(encodeURIComponent(word)),
9
9
  });
10
10
  };
11
11
  exports.default = crawlPolish;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var lib_1 = require("../lib");
4
4
  var crawlSpanish = function (word) {
5
- return lib_1.request({
5
+ return (0, lib_1.request)({
6
6
  protocol: 'https',
7
7
  hostname: 'www.diccionarios.com',
8
- path: "/diccionario/espanol/" + encodeURIComponent(word),
8
+ path: "/diccionario/espanol/".concat(encodeURIComponent(word)),
9
9
  });
10
10
  };
11
11
  exports.default = crawlSpanish;
@@ -43,10 +43,10 @@ var getWordDefinition = function (locale, word) { return __awaiter(void 0, void
43
43
  var html, _a, definitions, isAllowed, wordDefinition;
44
44
  return __generator(this, function (_b) {
45
45
  switch (_b.label) {
46
- case 0: return [4 /*yield*/, crawl_1.crawl(locale, word)];
46
+ case 0: return [4 /*yield*/, (0, crawl_1.crawl)(locale, word)];
47
47
  case 1:
48
48
  html = _b.sent();
49
- _a = parse_1.parse(locale, html), definitions = _a.definitions, isAllowed = _a.isAllowed;
49
+ _a = (0, parse_1.parse)(locale, html), definitions = _a.definitions, isAllowed = _a.isAllowed;
50
50
  wordDefinition = new types_1.WordDefinition({ definitions: definitions, isAllowed: isAllowed, word: word });
51
51
  return [2 /*return*/, wordDefinition];
52
52
  }
package/build/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var striptags_1 = __importDefault(require("striptags"));
7
7
  var EMPHASIS_TAGS = ['a', 'b', 'em', 'internalXref'];
8
- var normalizeHtmlTags = function (definition) { return striptags_1.default(striptags_1.default(definition, EMPHASIS_TAGS), undefined, '"'); };
8
+ var normalizeHtmlTags = function (definition) { return (0, striptags_1.default)((0, striptags_1.default)(definition, EMPHASIS_TAGS), undefined, '"'); };
9
9
  var normalizeLineBreaks = function (definition) { return definition.replace(/[\r\n]/g, ''); };
10
10
  var normalizeQuotes = function (definition) { return definition.replace(/\."/g, '".'); };
11
11
  /**
@@ -22,7 +22,7 @@ var parsePerLocale = (_a = {},
22
22
  var parse = function (locale, html) {
23
23
  var _a = parsePerLocale[locale](html), definitions = _a.definitions, isAllowed = _a.isAllowed;
24
24
  return {
25
- definitions: lib_1.unique(definitions.map(lib_1.normalizeDefinition).filter(Boolean)),
25
+ definitions: (0, lib_1.unique)(definitions.map(lib_1.normalizeDefinition).filter(Boolean)),
26
26
  isAllowed: isAllowed,
27
27
  };
28
28
  };
@@ -25,7 +25,7 @@ var parseSpanish = function (html) {
25
25
  .map(function (definition) { return $(definition).text().trim(); })
26
26
  .filter(Boolean)
27
27
  .map(function (definition) { return definition.replace(/\s+\.$/g, ''); })
28
- .map(function (definition) { return (definition.endsWith('.') ? definition : definition + "."); }),
28
+ .map(function (definition) { return (definition.endsWith('.') ? definition : "".concat(definition, ".")); }),
29
29
  isAllowed: definitions.length > 0,
30
30
  };
31
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.7.2",
3
+ "version": "2.8.1",
4
4
  "description": "Scrabble Solver 2 - Word definitions",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,13 +23,13 @@
23
23
  "clean": "rimraf build/ node_modules/ package-lock.json"
24
24
  },
25
25
  "dependencies": {
26
- "@scrabble-solver/types": "^2.7.2",
27
- "cheerio": "^1.0.0-rc.5",
28
- "follow-redirects": "^1.13.2",
29
- "striptags": "^3.1.1"
26
+ "@scrabble-solver/types": "^2.8.1",
27
+ "cheerio": "^1.0.0-rc.12",
28
+ "follow-redirects": "^1.15.2",
29
+ "striptags": "^3.2.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@types/follow-redirects": "^1.13.0"
32
+ "@types/follow-redirects": "^1.14.1"
33
33
  },
34
- "gitHead": "f1a2823c32eedaeff30cf8315e20427574fc97b7"
34
+ "gitHead": "994d5ef4a195cda08f7a907b8b1343bbc145801e"
35
35
  }