@scrabble-solver/types 2.15.7 → 2.15.9
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.
- package/LICENSE +1 -1
- package/build/Bonus.d.ts +1 -1
- package/build/Cell.js +0 -1
- package/build/CharacterBonus.d.ts +1 -1
- package/build/Result.js +0 -1
- package/package.json +3 -3
- package/src/Bonus.ts +1 -1
- package/src/Cell.ts +0 -1
- package/src/CharacterBonus.ts +1 -1
- package/src/Result.ts +0 -1
package/LICENSE
CHANGED
package/build/Bonus.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
|
|
|
2
2
|
import BonusJson from './BonusJson';
|
|
3
3
|
import BonusValue from './BonusValue';
|
|
4
4
|
import Cell from './Cell';
|
|
5
|
-
import Config from './Config';
|
|
5
|
+
import type Config from './Config';
|
|
6
6
|
declare abstract class Bonus {
|
|
7
7
|
readonly multiplier: number;
|
|
8
8
|
readonly score: number | undefined;
|
package/build/Cell.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Bonus from './Bonus';
|
|
2
2
|
import BonusValue from './BonusValue';
|
|
3
3
|
import Cell from './Cell';
|
|
4
|
-
import Config from './Config';
|
|
4
|
+
import type Config from './Config';
|
|
5
5
|
declare class CharacterBonus extends Bonus {
|
|
6
6
|
readonly type = "BONUS_CHARACTER";
|
|
7
7
|
canApply(config: Config, cell: Cell): boolean;
|
package/build/Result.js
CHANGED
|
@@ -45,7 +45,6 @@ const getConsonants = (tiles) => tiles.filter(isConsonant);
|
|
|
45
45
|
const getVowels = (tiles) => tiles.filter(isVowel);
|
|
46
46
|
const getPointsRatio = (tiles, points) => points / tiles.length;
|
|
47
47
|
const getTiles = (cells) => cells.filter(({ isEmpty }) => isEmpty).map(({ tile }) => tile);
|
|
48
|
-
// eslint-disable-next-line prefer-template
|
|
49
48
|
const getWord = (cells) => cells.reduce((word, cell) => word + cell.toString(), '');
|
|
50
49
|
const getWords = (cells, collisions) => [cells, ...collisions].map(getWord);
|
|
51
50
|
const isConsonant = ({ character, isBlank }) => constants_1.CONSONANTS.includes(character) && !isBlank;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scrabble-solver/types",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.9",
|
|
4
4
|
"description": "Scrabble Solver 2 - Types",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"clean": "rimraf build/"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@scrabble-solver/constants": "^2.15.
|
|
26
|
+
"@scrabble-solver/constants": "^2.15.9"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "d0654f37094c58a9982d7984e3fc8722f1fa24f0"
|
|
29
29
|
}
|
package/src/Bonus.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
|
|
|
3
3
|
import BonusJson from './BonusJson';
|
|
4
4
|
import BonusValue from './BonusValue';
|
|
5
5
|
import Cell from './Cell';
|
|
6
|
-
import Config from './Config';
|
|
6
|
+
import type Config from './Config';
|
|
7
7
|
|
|
8
8
|
abstract class Bonus {
|
|
9
9
|
public readonly multiplier: number;
|
package/src/Cell.ts
CHANGED
package/src/CharacterBonus.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BONUS_CHARACTER } from '@scrabble-solver/constants';
|
|
|
3
3
|
import Bonus from './Bonus';
|
|
4
4
|
import BonusValue from './BonusValue';
|
|
5
5
|
import Cell from './Cell';
|
|
6
|
-
import Config from './Config';
|
|
6
|
+
import type Config from './Config';
|
|
7
7
|
|
|
8
8
|
class CharacterBonus extends Bonus {
|
|
9
9
|
public readonly type = BONUS_CHARACTER;
|
package/src/Result.ts
CHANGED
|
@@ -92,7 +92,6 @@ const getPointsRatio = (tiles: Tile[], points: number): number => points / tiles
|
|
|
92
92
|
|
|
93
93
|
const getTiles = (cells: Cell[]): Tile[] => cells.filter(({ isEmpty }) => isEmpty).map(({ tile }) => tile);
|
|
94
94
|
|
|
95
|
-
// eslint-disable-next-line prefer-template
|
|
96
95
|
const getWord = (cells: Cell[]): string => cells.reduce((word, cell) => word + cell.toString(), '');
|
|
97
96
|
|
|
98
97
|
const getWords = (cells: Cell[], collisions: Collision[]): string[] => [cells, ...collisions].map(getWord);
|