@scrabble-solver/word-lists 2.13.1 → 2.13.3

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.
@@ -1,14 +1,10 @@
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
3
  const types_1 = require("@scrabble-solver/types");
7
- const latinize_1 = __importDefault(require("latinize"));
8
4
  const lib_1 = require("./lib");
9
5
  const FILE_URL = 'https://raw.githubusercontent.com/Thecoolsim/French-Scrabble-ODS8/main/French%20ODS%20dictionary.txt';
10
6
  const getFrFrWordList = async () => {
11
7
  const words = await (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.FR_FR);
12
- return words.map(latinize_1.default);
8
+ return (0, lib_1.latinizeDiacritics)(words);
13
9
  };
14
10
  exports.default = getFrFrWordList;
@@ -1,14 +1,10 @@
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
3
  const types_1 = require("@scrabble-solver/types");
7
- const latinize_1 = __importDefault(require("latinize"));
8
4
  const lib_1 = require("./lib");
9
5
  const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/scrabble-dictionaries/master/romanian/loc-5.0.txt';
10
6
  const getRoRoWordList = async () => {
11
7
  const words = await (0, lib_1.getTxtWordList)(FILE_URL, types_1.Locale.RO_RO);
12
- return words.map(latinize_1.default);
8
+ return (0, lib_1.latinizeDiacritics)(words);
13
9
  };
14
10
  exports.default = getRoRoWordList;
@@ -5,4 +5,6 @@ export { default as findFirstWordIndex } from './findFirstWordIndex';
5
5
  export { default as getHash } from './getHash';
6
6
  export { default as getTempFilepath } from './getTempFilepath';
7
7
  export { default as getTxtWordList } from './getTxtWordList';
8
+ export { default as latinizeDiacritics } from './latinizeDiacritics';
9
+ export { default as unique } from './unique';
8
10
  export { default as unzip } from './unzip';
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.unzip = exports.getTxtWordList = exports.getTempFilepath = exports.getHash = exports.findFirstWordIndex = exports.extractWords = exports.downloadHtml = exports.downloadFile = void 0;
6
+ exports.unzip = exports.unique = exports.latinizeDiacritics = exports.getTxtWordList = exports.getTempFilepath = exports.getHash = exports.findFirstWordIndex = exports.extractWords = exports.downloadHtml = exports.downloadFile = void 0;
7
7
  var downloadFile_1 = require("./downloadFile");
8
8
  Object.defineProperty(exports, "downloadFile", { enumerable: true, get: function () { return __importDefault(downloadFile_1).default; } });
9
9
  var downloadHtml_1 = require("./downloadHtml");
@@ -18,5 +18,9 @@ var getTempFilepath_1 = require("./getTempFilepath");
18
18
  Object.defineProperty(exports, "getTempFilepath", { enumerable: true, get: function () { return __importDefault(getTempFilepath_1).default; } });
19
19
  var getTxtWordList_1 = require("./getTxtWordList");
20
20
  Object.defineProperty(exports, "getTxtWordList", { enumerable: true, get: function () { return __importDefault(getTxtWordList_1).default; } });
21
+ var latinizeDiacritics_1 = require("./latinizeDiacritics");
22
+ Object.defineProperty(exports, "latinizeDiacritics", { enumerable: true, get: function () { return __importDefault(latinizeDiacritics_1).default; } });
23
+ var unique_1 = require("./unique");
24
+ Object.defineProperty(exports, "unique", { enumerable: true, get: function () { return __importDefault(unique_1).default; } });
21
25
  var unzip_1 = require("./unzip");
22
26
  Object.defineProperty(exports, "unzip", { enumerable: true, get: function () { return __importDefault(unzip_1).default; } });
@@ -0,0 +1,2 @@
1
+ declare const latinizeDiacritics: (words: string[]) => string[];
2
+ export default latinizeDiacritics;
@@ -0,0 +1,11 @@
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 latinize_1 = __importDefault(require("latinize"));
7
+ const unique_1 = __importDefault(require("./unique"));
8
+ const latinizeDiacritics = (words) => {
9
+ return (0, unique_1.default)(words.map((word) => (0, latinize_1.default)(word)));
10
+ };
11
+ exports.default = latinizeDiacritics;
@@ -0,0 +1,2 @@
1
+ declare const unique: <T>(array: T[]) => T[];
2
+ export default unique;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const unique = (array) => Array.from(new Set(array));
4
+ exports.default = unique;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-lists",
3
- "version": "2.13.1",
3
+ "version": "2.13.3",
4
4
  "description": "Scrabble Solver 2 - Word lists",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -20,20 +20,19 @@
20
20
  "homepage": "https://scrabble-solver.org",
21
21
  "scripts": {
22
22
  "build": "tsc --project .",
23
- "clean": "rimraf build/ node_modules/",
24
- "clean:force": "npm run clean && rimraf package-lock.json"
23
+ "clean": "rimraf build/"
25
24
  },
26
25
  "dependencies": {
27
- "@scrabble-solver/types": "^2.13.1",
26
+ "@scrabble-solver/types": "^2.13.3",
28
27
  "cheerio": "^1.0.0-rc.12",
29
- "follow-redirects": "^1.15.2",
28
+ "follow-redirects": "^1.15.5",
30
29
  "latinize": "^1.0.0",
31
- "unzipper": "^0.10.11"
30
+ "unzipper": "^0.10.14"
32
31
  },
33
32
  "devDependencies": {
34
- "@types/follow-redirects": "^1.14.1",
35
- "@types/latinize": "^0.2.17",
36
- "@types/unzipper": "^0.10.5"
33
+ "@types/follow-redirects": "^1.14.4",
34
+ "@types/latinize": "^0.2.18",
35
+ "@types/unzipper": "^0.10.9"
37
36
  },
38
- "gitHead": "0588fd5c88be44c2f3e96d8cf8cc6fa7166c924c"
37
+ "gitHead": "31303d61debbf33259e53af5ea7c187c4a75391d"
39
38
  }
@@ -1,13 +1,12 @@
1
1
  import { Locale } from '@scrabble-solver/types';
2
- import latinize from 'latinize';
3
2
 
4
- import { getTxtWordList } from './lib';
3
+ import { getTxtWordList, latinizeDiacritics } from './lib';
5
4
 
6
5
  const FILE_URL = 'https://raw.githubusercontent.com/Thecoolsim/French-Scrabble-ODS8/main/French%20ODS%20dictionary.txt';
7
6
 
8
7
  const getFrFrWordList = async (): Promise<string[]> => {
9
8
  const words = await getTxtWordList(FILE_URL, Locale.FR_FR);
10
- return words.map(latinize);
9
+ return latinizeDiacritics(words);
11
10
  };
12
11
 
13
12
  export default getFrFrWordList;
@@ -1,13 +1,12 @@
1
1
  import { Locale } from '@scrabble-solver/types';
2
- import latinize from 'latinize';
3
2
 
4
- import { getTxtWordList } from './lib';
3
+ import { getTxtWordList, latinizeDiacritics } from './lib';
5
4
 
6
5
  const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/scrabble-dictionaries/master/romanian/loc-5.0.txt';
7
6
 
8
7
  const getRoRoWordList = async (): Promise<string[]> => {
9
8
  const words = await getTxtWordList(FILE_URL, Locale.RO_RO);
10
- return words.map(latinize);
9
+ return latinizeDiacritics(words);
11
10
  };
12
11
 
13
12
  export default getRoRoWordList;
package/src/lib/index.ts CHANGED
@@ -5,4 +5,6 @@ export { default as findFirstWordIndex } from './findFirstWordIndex';
5
5
  export { default as getHash } from './getHash';
6
6
  export { default as getTempFilepath } from './getTempFilepath';
7
7
  export { default as getTxtWordList } from './getTxtWordList';
8
+ export { default as latinizeDiacritics } from './latinizeDiacritics';
9
+ export { default as unique } from './unique';
8
10
  export { default as unzip } from './unzip';
@@ -0,0 +1,9 @@
1
+ import latinize from 'latinize';
2
+
3
+ import unique from './unique';
4
+
5
+ const latinizeDiacritics = (words: string[]): string[] => {
6
+ return unique(words.map((word) => latinize(word)));
7
+ };
8
+
9
+ export default latinizeDiacritics;
@@ -0,0 +1,3 @@
1
+ const unique = <T>(array: T[]): T[] => Array.from(new Set(array));
2
+
3
+ export default unique;