@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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2024 Kamil Mielnik <kamil@kamilmielnik.com>
1
+ Copyright (c) 2025 Kamil Mielnik <kamil@kamilmielnik.com>
2
2
 
3
3
  Attribution-NonCommercial-NoDerivatives 4.0 International
4
4
 
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
@@ -13,7 +13,6 @@ class Cell {
13
13
  y: json.y,
14
14
  });
15
15
  }
16
- // eslint-disable-next-line no-undef
17
16
  constructor({ isEmpty = true, tile = Tile_1.default.Null, x, y }) {
18
17
  this.isEmpty = isEmpty;
19
18
  this.tile = tile;
@@ -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.7",
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.7"
26
+ "@scrabble-solver/constants": "^2.15.9"
27
27
  },
28
- "gitHead": "956fc26bb07f8b86f3889627f636369e460730ce"
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
@@ -19,7 +19,6 @@ class Cell {
19
19
 
20
20
  public readonly y: number;
21
21
 
22
- // eslint-disable-next-line no-undef
23
22
  constructor({ isEmpty = true, tile = Tile.Null, x, y }: { isEmpty?: boolean; tile?: Tile; x: number; y: number }) {
24
23
  this.isEmpty = isEmpty;
25
24
  this.tile = tile;
@@ -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);