@scrabble-solver/types 2.9.1 → 2.9.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.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021 Kamil Mielnik <kamil.adam.mielnik@gmail.com>
1
+ Copyright (c) 2022 Kamil Mielnik <kamil@kamilmielnik.com>
2
2
 
3
3
  Attribution-NonCommercial-NoDerivatives 4.0 International
4
4
 
@@ -3,13 +3,16 @@ declare class WordDefinition {
3
3
  static fromJson(json: WordDefinitionJson | null): WordDefinition;
4
4
  static readonly Null: WordDefinition;
5
5
  readonly definitions: string[];
6
+ /**
7
+ * Does the word have an entry in a corresponding online dictionary?
8
+ */
9
+ readonly exists: boolean;
10
+ /**
11
+ * Can the word be legally used in the game?
12
+ */
6
13
  readonly isAllowed: boolean;
7
14
  readonly word: string;
8
- constructor({ definitions, isAllowed, word }: {
9
- definitions: string[];
10
- isAllowed: boolean;
11
- word: string;
12
- });
15
+ constructor({ definitions, exists, isAllowed, word }: WordDefinitionJson);
13
16
  toJson(): WordDefinitionJson | null;
14
17
  }
15
18
  export default WordDefinition;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class WordDefinition {
4
- constructor({ definitions, isAllowed, word }) {
4
+ constructor({ definitions, exists, isAllowed, word }) {
5
5
  this.definitions = definitions;
6
+ this.exists = exists;
6
7
  this.isAllowed = isAllowed;
7
8
  this.word = word;
8
9
  }
@@ -12,6 +13,7 @@ class WordDefinition {
12
13
  }
13
14
  return new WordDefinition({
14
15
  definitions: json.definitions,
16
+ exists: json.exists,
15
17
  isAllowed: json.isAllowed,
16
18
  word: json.word,
17
19
  });
@@ -19,6 +21,7 @@ class WordDefinition {
19
21
  toJson() {
20
22
  return {
21
23
  definitions: this.definitions,
24
+ exists: this.exists,
22
25
  isAllowed: this.isAllowed,
23
26
  word: this.word,
24
27
  };
@@ -26,6 +29,7 @@ class WordDefinition {
26
29
  }
27
30
  WordDefinition.Null = Object.freeze({
28
31
  definitions: [],
32
+ exists: false,
29
33
  isAllowed: false,
30
34
  word: '',
31
35
  toJson: () => null,
@@ -1,5 +1,12 @@
1
1
  interface WordDefinitionJson {
2
2
  definitions: string[];
3
+ /**
4
+ * Does the word have an entry in a corresponding online dictionary?
5
+ */
6
+ exists: boolean;
7
+ /**
8
+ * Can the word be legally used in the game?
9
+ */
3
10
  isAllowed: boolean;
4
11
  word: string;
5
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/types",
3
- "version": "2.9.1",
3
+ "version": "2.9.2",
4
4
  "description": "Scrabble Solver 2 - Types",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -10,8 +10,8 @@
10
10
  },
11
11
  "author": {
12
12
  "name": "Kamil Mielnik",
13
- "email": "kamil.adam.mielnik@gmail.com",
14
- "url": "https://kamilmielnik.com/"
13
+ "email": "kamil@kamilmielnik.com",
14
+ "url": "https://kamilmielnik.com"
15
15
  },
16
16
  "license": "CC-BY-NC-ND-4.0",
17
17
  "bugs": {
@@ -24,7 +24,7 @@
24
24
  "clean:force": "npm run clean && rimraf package-lock.json"
25
25
  },
26
26
  "dependencies": {
27
- "@scrabble-solver/constants": "^2.9.1"
27
+ "@scrabble-solver/constants": "^2.9.2"
28
28
  },
29
- "gitHead": "4849b4d123131fe043174f000c523868f3bd68c5"
29
+ "gitHead": "f50d782088cb89544f0c2c504f31fca81a6ff409"
30
30
  }
@@ -8,6 +8,7 @@ class WordDefinition {
8
8
 
9
9
  return new WordDefinition({
10
10
  definitions: json.definitions,
11
+ exists: json.exists,
11
12
  isAllowed: json.isAllowed,
12
13
  word: json.word,
13
14
  });
@@ -15,6 +16,7 @@ class WordDefinition {
15
16
 
16
17
  public static readonly Null: WordDefinition = Object.freeze({
17
18
  definitions: [],
19
+ exists: false,
18
20
  isAllowed: false,
19
21
  word: '',
20
22
  toJson: () => null,
@@ -22,12 +24,21 @@ class WordDefinition {
22
24
 
23
25
  public readonly definitions: string[];
24
26
 
27
+ /**
28
+ * Does the word have an entry in a corresponding online dictionary?
29
+ */
30
+ public readonly exists: boolean;
31
+
32
+ /**
33
+ * Can the word be legally used in the game?
34
+ */
25
35
  public readonly isAllowed: boolean;
26
36
 
27
37
  public readonly word: string;
28
38
 
29
- constructor({ definitions, isAllowed, word }: { definitions: string[]; isAllowed: boolean; word: string }) {
39
+ constructor({ definitions, exists, isAllowed, word }: WordDefinitionJson) {
30
40
  this.definitions = definitions;
41
+ this.exists = exists;
31
42
  this.isAllowed = isAllowed;
32
43
  this.word = word;
33
44
  }
@@ -35,6 +46,7 @@ class WordDefinition {
35
46
  public toJson(): WordDefinitionJson | null {
36
47
  return {
37
48
  definitions: this.definitions,
49
+ exists: this.exists,
38
50
  isAllowed: this.isAllowed,
39
51
  word: this.word,
40
52
  };
@@ -1,5 +1,12 @@
1
1
  interface WordDefinitionJson {
2
2
  definitions: string[];
3
+ /**
4
+ * Does the word have an entry in a corresponding online dictionary?
5
+ */
6
+ exists: boolean;
7
+ /**
8
+ * Can the word be legally used in the game?
9
+ */
3
10
  isAllowed: boolean;
4
11
  word: string;
5
12
  }