@scrabble-solver/word-lists 2.7.1 → 2.7.2

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.
@@ -44,7 +44,7 @@ var memfs_1 = require("memfs");
44
44
  var unzipper_1 = __importDefault(require("unzipper"));
45
45
  var url_1 = require("url");
46
46
  var lib_1 = require("./lib");
47
- var PAGE_URL = 'https://sjp.pl/slownik/growy/';
47
+ var PAGE_URL = 'https://sjp.pl/sl/growy/';
48
48
  var FILE_TO_EXTRACT_FROM_ZIP = 'slowa.txt';
49
49
  var getPlPlWordList = function () { return __awaiter(void 0, void 0, void 0, function () {
50
50
  var zipTempFilename, tempFilename, zipUrl, file, words;
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var http_1 = __importDefault(require("http"));
7
- var https_1 = __importDefault(require("https"));
3
+ var follow_redirects_1 = require("follow-redirects");
8
4
  var downloadFile = function (url, outputStream) {
9
5
  return new Promise(function (resolve, reject) {
10
- var protocol = url.startsWith('https') ? https_1.default : http_1.default;
6
+ var protocol = url.startsWith('https') ? follow_redirects_1.https : follow_redirects_1.http;
11
7
  var request = protocol.get(url, function (response) {
12
8
  if (typeof response.statusCode === 'undefined' || response.statusCode >= 400) {
13
9
  reject();
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var http_1 = __importDefault(require("http"));
7
- var https_1 = __importDefault(require("https"));
3
+ var follow_redirects_1 = require("follow-redirects");
8
4
  var downloadHtml = function (url) {
9
5
  return new Promise(function (resolve, reject) {
10
- var protocol = url.startsWith('https') ? https_1.default : http_1.default;
6
+ var protocol = url.startsWith('https') ? follow_redirects_1.https : follow_redirects_1.http;
11
7
  protocol.get(url, function (response) {
12
8
  var data = '';
13
9
  response.setEncoding('utf8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-lists",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "Scrabble Solver 2 - Word lists",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -24,13 +24,15 @@
24
24
  "clean:force": "npm run clean && rimraf package-lock.json"
25
25
  },
26
26
  "dependencies": {
27
- "@scrabble-solver/types": "^2.7.1",
27
+ "@scrabble-solver/types": "^2.7.2",
28
28
  "cheerio": "^1.0.0-rc.5",
29
+ "follow-redirects": "^1.15.1",
29
30
  "memfs": "^3.2.0",
30
31
  "unzipper": "^0.10.11"
31
32
  },
32
33
  "devDependencies": {
34
+ "@types/follow-redirects": "^1.14.1",
33
35
  "@types/unzipper": "^0.10.3"
34
36
  },
35
- "gitHead": "c6b191428962656e3d5fedecd20043f596897a15"
37
+ "gitHead": "f1a2823c32eedaeff30cf8315e20427574fc97b7"
36
38
  }
@@ -5,7 +5,7 @@ import { URL } from 'url';
5
5
 
6
6
  import { downloadFile, downloadHtml, extractWords, getTempFilename } from './lib';
7
7
 
8
- const PAGE_URL = 'https://sjp.pl/slownik/growy/';
8
+ const PAGE_URL = 'https://sjp.pl/sl/growy/';
9
9
  const FILE_TO_EXTRACT_FROM_ZIP = 'slowa.txt';
10
10
 
11
11
  const getPlPlWordList = async (): Promise<string[]> => {
@@ -1,5 +1,4 @@
1
- import http from 'http';
2
- import https from 'https';
1
+ import { http, https } from 'follow-redirects';
3
2
  import { Writable } from 'stream';
4
3
 
5
4
  const downloadFile = (url: string, outputStream: Writable): Promise<void> => {
@@ -1,5 +1,4 @@
1
- import http from 'http';
2
- import https from 'https';
1
+ import { http, https } from 'follow-redirects';
3
2
 
4
3
  const downloadHtml = (url: string): Promise<string> => {
5
4
  return new Promise((resolve, reject) => {