@kekkle/shared 2.0.1 → 2.1.1

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.
Files changed (76) hide show
  1. package/dist/cjs/constants/collections.d.ts +4 -0
  2. package/dist/cjs/constants/collections.d.ts.map +1 -1
  3. package/dist/cjs/constants/collections.js +5 -1
  4. package/dist/cjs/convertors/node/wordle6-game-state-document.converter.d.ts +4 -0
  5. package/dist/cjs/convertors/node/wordle6-game-state-document.converter.d.ts.map +1 -0
  6. package/dist/cjs/convertors/node/wordle6-game-state-document.converter.js +23 -0
  7. package/dist/cjs/convertors/web/wordle6-game-state-document.converter.d.ts +4 -0
  8. package/dist/cjs/convertors/web/wordle6-game-state-document.converter.d.ts.map +1 -0
  9. package/dist/cjs/convertors/web/wordle6-game-state-document.converter.js +23 -0
  10. package/dist/cjs/helpers/worlde/reconstruct-game-state.d.ts +3 -0
  11. package/dist/cjs/helpers/worlde/reconstruct-game-state.d.ts.map +1 -0
  12. package/dist/cjs/helpers/worlde/reconstruct-game-state.js +51 -0
  13. package/dist/cjs/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.d.ts +6 -0
  14. package/dist/cjs/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.d.ts.map +1 -0
  15. package/dist/cjs/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.js +2 -0
  16. package/dist/cjs/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.d.ts +6 -0
  17. package/dist/cjs/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.d.ts.map +1 -0
  18. package/dist/cjs/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.js +2 -0
  19. package/dist/cjs/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.d.ts +9 -0
  20. package/dist/cjs/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.d.ts.map +1 -0
  21. package/dist/cjs/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js +2 -0
  22. package/dist/cjs/types/documents/wordle6-game-state-document/wordle6-game-state-document.d.ts +11 -0
  23. package/dist/cjs/types/documents/wordle6-game-state-document/wordle6-game-state-document.d.ts.map +1 -0
  24. package/dist/cjs/types/documents/wordle6-game-state-document/wordle6-game-state-document.js +2 -0
  25. package/dist/esm/constants/collections.d.ts +4 -0
  26. package/dist/esm/constants/collections.d.ts.map +1 -1
  27. package/dist/esm/constants/collections.js +4 -0
  28. package/dist/esm/convertors/node/wordle6-game-state-document.converter.d.ts +4 -0
  29. package/dist/esm/convertors/node/wordle6-game-state-document.converter.d.ts.map +1 -0
  30. package/dist/esm/convertors/node/wordle6-game-state-document.converter.js +20 -0
  31. package/dist/esm/convertors/web/wordle6-game-state-document.converter.d.ts +4 -0
  32. package/dist/esm/convertors/web/wordle6-game-state-document.converter.d.ts.map +1 -0
  33. package/dist/esm/convertors/web/wordle6-game-state-document.converter.js +20 -0
  34. package/dist/esm/helpers/worlde/reconstruct-game-state.d.ts +3 -0
  35. package/dist/esm/helpers/worlde/reconstruct-game-state.d.ts.map +1 -0
  36. package/dist/esm/helpers/worlde/reconstruct-game-state.js +48 -0
  37. package/dist/esm/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.d.ts +6 -0
  38. package/dist/esm/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.d.ts.map +1 -0
  39. package/dist/esm/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.js +1 -0
  40. package/dist/esm/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.d.ts +6 -0
  41. package/dist/esm/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.d.ts.map +1 -0
  42. package/dist/esm/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.js +1 -0
  43. package/dist/esm/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.d.ts +9 -0
  44. package/dist/esm/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.d.ts.map +1 -0
  45. package/dist/esm/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js +1 -0
  46. package/dist/esm/types/documents/wordle6-game-state-document/wordle6-game-state-document.d.ts +11 -0
  47. package/dist/esm/types/documents/wordle6-game-state-document/wordle6-game-state-document.d.ts.map +1 -0
  48. package/dist/esm/types/documents/wordle6-game-state-document/wordle6-game-state-document.js +1 -0
  49. package/dist/node/constants/collections.d.ts +4 -0
  50. package/dist/node/constants/collections.d.ts.map +1 -1
  51. package/dist/node/constants/collections.js +4 -0
  52. package/dist/node/convertors/node/wordle6-game-state-document.converter.d.ts +4 -0
  53. package/dist/node/convertors/node/wordle6-game-state-document.converter.d.ts.map +1 -0
  54. package/dist/node/convertors/node/wordle6-game-state-document.converter.js +20 -0
  55. package/dist/node/convertors/web/wordle6-game-state-document.converter.d.ts +4 -0
  56. package/dist/node/convertors/web/wordle6-game-state-document.converter.d.ts.map +1 -0
  57. package/dist/node/convertors/web/wordle6-game-state-document.converter.js +20 -0
  58. package/dist/node/helpers/worlde/reconstruct-game-state.d.ts +3 -0
  59. package/dist/node/helpers/worlde/reconstruct-game-state.d.ts.map +1 -0
  60. package/dist/node/helpers/worlde/reconstruct-game-state.js +48 -0
  61. package/dist/node/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.d.ts +6 -0
  62. package/dist/node/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.d.ts.map +1 -0
  63. package/dist/node/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.js +1 -0
  64. package/dist/node/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.d.ts +6 -0
  65. package/dist/node/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.d.ts.map +1 -0
  66. package/dist/node/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.js +1 -0
  67. package/dist/node/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.d.ts +9 -0
  68. package/dist/node/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.d.ts.map +1 -0
  69. package/dist/node/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js +1 -0
  70. package/dist/node/types/documents/wordle6-game-state-document/wordle6-game-state-document.d.ts +11 -0
  71. package/dist/node/types/documents/wordle6-game-state-document/wordle6-game-state-document.d.ts.map +1 -0
  72. package/dist/node/types/documents/wordle6-game-state-document/wordle6-game-state-document.js +1 -0
  73. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  74. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  75. package/dist/tsconfig.node.tsbuildinfo +1 -1
  76. package/package.json +9 -1
@@ -4,4 +4,8 @@ export declare const WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
4
4
  export declare const WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
5
5
  export declare const WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
6
6
  export declare const WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
7
+ export declare const WORDLE6_GAMES_COLLECTION_PATH = "wordle6_games";
8
+ export declare const WORDLE6_LEADERBOARD_COLLECTION_PATH = "wordle6_leaderboard";
9
+ export declare const WORDLE6_MONTHLY_SCORES_COLLECTION_PATH = "wordle6_monthly_scores";
10
+ export declare const WORDLE6_SCORES_COLLECTION_PATH = "wordle6_scores";
7
11
  //# sourceMappingURL=collections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/constants/collections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kBAAkB,CAAC"}
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/constants/collections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,mCAAmC,wBAAwB,CAAC;AACzE,eAAO,MAAM,sCAAsC,2BAA2B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,mBAAmB,CAAC"}
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WORDLE_SCORES_COLLECTION_PATH = exports.WORDLE_MONTHLY_SCORES_COLLECTION_PATH = exports.WORDLE_LEADERBOARD_COLLECTION_PATH = exports.WORDLE_GAMES_COLLECTION_PATH = exports.GROUP_COLLECTION_PATH = exports.USER_COLLECTION_PATH = void 0;
3
+ exports.WORDLE6_SCORES_COLLECTION_PATH = exports.WORDLE6_MONTHLY_SCORES_COLLECTION_PATH = exports.WORDLE6_LEADERBOARD_COLLECTION_PATH = exports.WORDLE6_GAMES_COLLECTION_PATH = exports.WORDLE_SCORES_COLLECTION_PATH = exports.WORDLE_MONTHLY_SCORES_COLLECTION_PATH = exports.WORDLE_LEADERBOARD_COLLECTION_PATH = exports.WORDLE_GAMES_COLLECTION_PATH = exports.GROUP_COLLECTION_PATH = exports.USER_COLLECTION_PATH = void 0;
4
4
  exports.USER_COLLECTION_PATH = "users";
5
5
  exports.GROUP_COLLECTION_PATH = "groups";
6
6
  exports.WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
7
7
  exports.WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
8
8
  exports.WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
9
9
  exports.WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
10
+ exports.WORDLE6_GAMES_COLLECTION_PATH = "wordle6_games";
11
+ exports.WORDLE6_LEADERBOARD_COLLECTION_PATH = "wordle6_leaderboard";
12
+ exports.WORDLE6_MONTHLY_SCORES_COLLECTION_PATH = "wordle6_monthly_scores";
13
+ exports.WORDLE6_SCORES_COLLECTION_PATH = "wordle6_scores";
@@ -0,0 +1,4 @@
1
+ import type { Wordle6GameStateDocument } from "../../types/documents/wordle6-game-state-document/wordle6-game-state-document.js";
2
+ import { type FirestoreDataConverter } from "firebase-admin/firestore";
3
+ export declare const wordle6GameStateDocumentConverter: FirestoreDataConverter<Wordle6GameStateDocument>;
4
+ //# sourceMappingURL=wordle6-game-state-document.converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.converter.d.ts","sourceRoot":"","sources":["../../../../src/convertors/node/wordle6-game-state-document.converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AAC7H,OAAO,EAEL,KAAK,sBAAsB,EAI5B,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,iCAAiC,EAAE,sBAAsB,CAAC,wBAAwB,CAyB5F,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wordle6GameStateDocumentConverter = void 0;
4
+ const firestore_1 = require("firebase-admin/firestore");
5
+ exports.wordle6GameStateDocumentConverter = {
6
+ toFirestore: (doc) => {
7
+ const { _id, ...docWithoutId } = doc;
8
+ return {
9
+ ...docWithoutId,
10
+ updated_at: docWithoutId.updated_at instanceof Date
11
+ ? firestore_1.Timestamp.fromDate(docWithoutId.updated_at)
12
+ : docWithoutId.updated_at,
13
+ };
14
+ },
15
+ fromFirestore: (snapshot) => {
16
+ const data = snapshot.data();
17
+ return {
18
+ _id: snapshot.id,
19
+ ...data,
20
+ updated_at: data.updated_at.toDate(),
21
+ };
22
+ },
23
+ };
@@ -0,0 +1,4 @@
1
+ import type { Wordle6GameStateDocument } from "../../types/documents/wordle6-game-state-document/wordle6-game-state-document.js";
2
+ import { type FirestoreDataConverter } from "firebase/firestore";
3
+ export declare const wordle6GameStateDocumentConverter: FirestoreDataConverter<Wordle6GameStateDocument>;
4
+ //# sourceMappingURL=wordle6-game-state-document.converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.converter.d.ts","sourceRoot":"","sources":["../../../../src/convertors/web/wordle6-game-state-document.converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AAC7H,OAAO,EAEL,KAAK,sBAAsB,EAI5B,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,iCAAiC,EAAE,sBAAsB,CAAC,wBAAwB,CA2B5F,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wordle6GameStateDocumentConverter = void 0;
4
+ const firestore_1 = require("firebase/firestore");
5
+ exports.wordle6GameStateDocumentConverter = {
6
+ toFirestore: (doc) => {
7
+ const { _id, ...docWithoutId } = doc;
8
+ return {
9
+ ...docWithoutId,
10
+ updated_at: docWithoutId.updated_at instanceof Date
11
+ ? firestore_1.Timestamp.fromDate(docWithoutId.updated_at)
12
+ : docWithoutId.updated_at,
13
+ };
14
+ },
15
+ fromFirestore: (snapshot) => {
16
+ const data = snapshot.data();
17
+ return {
18
+ _id: snapshot.id,
19
+ ...data,
20
+ updated_at: data.updated_at.toDate(),
21
+ };
22
+ },
23
+ };
@@ -0,0 +1,3 @@
1
+ import type { WordleGameState } from "../../types/fields/wordle-game-state/wordle-game-state.js";
2
+ export declare function reconstructGameState(guesses: string[], correctWord: string, maxRows: number): WordleGameState;
3
+ //# sourceMappingURL=reconstruct-game-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconstruct-game-state.d.ts","sourceRoot":"","sources":["../../../../src/helpers/worlde/reconstruct-game-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,uDAAuD,CAAC;AAE/D,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,eAAe,CAcjB"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reconstructGameState = reconstructGameState;
4
+ function reconstructGameState(guesses, correctWord, maxRows) {
5
+ const wordLength = correctWord.length;
6
+ const rows = [];
7
+ for (const guess of guesses) {
8
+ const row = evaluateGuess(guess, correctWord);
9
+ rows.push(row);
10
+ }
11
+ while (rows.length < maxRows) {
12
+ rows.push(createEmptyRow(wordLength));
13
+ }
14
+ return rows;
15
+ }
16
+ function evaluateGuess(guess, correctWord) {
17
+ const row = Array.from({ length: guess.length }, () => ({
18
+ character: "",
19
+ isCorrect: false,
20
+ isLocked: true,
21
+ }));
22
+ const correctWordCounts = {};
23
+ for (const char of correctWord) {
24
+ correctWordCounts[char] = (correctWordCounts[char] || 0) + 1;
25
+ }
26
+ const markedCounts = {};
27
+ for (let i = 0; i < guess.length; i++) {
28
+ row[i].character = guess[i];
29
+ if (guess[i] === correctWord[i]) {
30
+ row[i].isCorrect = true;
31
+ markedCounts[guess[i]] = (markedCounts[guess[i]] || 0) + 1;
32
+ }
33
+ }
34
+ for (let i = 0; i < guess.length; i++) {
35
+ if (!row[i].isCorrect && correctWord.includes(guess[i])) {
36
+ markedCounts[guess[i]] = (markedCounts[guess[i]] || 0) + 1;
37
+ if (markedCounts[guess[i]] <= correctWordCounts[guess[i]]) {
38
+ row[i].isPresent = true;
39
+ }
40
+ }
41
+ }
42
+ return row;
43
+ }
44
+ function createEmptyRow(wordLength) {
45
+ return Array.from({ length: wordLength }, () => ({
46
+ character: "",
47
+ isCorrect: false,
48
+ isPresent: false,
49
+ isLocked: false,
50
+ }));
51
+ }
@@ -0,0 +1,6 @@
1
+ import type { Timestamp } from "firebase-admin/firestore";
2
+ import type { Wordle6GameStateDocumentFirestoreBase } from "../../../../types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js";
3
+ export type Wordle6GameStateDocumentFirestore = Wordle6GameStateDocumentFirestoreBase & {
4
+ updated_at: Timestamp;
5
+ };
6
+ //# sourceMappingURL=wordle6-game-state-document-firestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document-firestore.d.ts","sourceRoot":"","sources":["../../../../../../src/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AAEzJ,MAAM,MAAM,iCAAiC,GAC3C,qCAAqC,GAAG;IACtC,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import type { Timestamp } from "firebase/firestore";
2
+ import type { Wordle6GameStateDocumentFirestoreBase } from "../../../../types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js";
3
+ export type Wordle6GameStateDocumentFirestore = Wordle6GameStateDocumentFirestoreBase & {
4
+ updated_at: Timestamp;
5
+ };
6
+ //# sourceMappingURL=wordle6-game-state-document-firestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document-firestore.d.ts","sourceRoot":"","sources":["../../../../../../src/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AAEzJ,MAAM,MAAM,iCAAiC,GAC3C,qCAAqC,GAAG;IACtC,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export type Wordle6GameStateDocumentFirestoreBase = {
2
+ guesses: string[];
3
+ has_finished: boolean;
4
+ has_lost: boolean;
5
+ has_won: boolean;
6
+ number_of_tries_needed: number;
7
+ user_id: string;
8
+ };
9
+ //# sourceMappingURL=wordle6-game-state-document-firestore-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document-firestore-base.d.ts","sourceRoot":"","sources":["../../../../../src/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qCAAqC,GAAG;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ export type Wordle6GameStateDocument = {
2
+ _id: string;
3
+ guesses: string[];
4
+ has_finished: boolean;
5
+ has_lost: boolean;
6
+ has_won: boolean;
7
+ number_of_tries_needed: number;
8
+ updated_at: Date;
9
+ user_id: string;
10
+ };
11
+ //# sourceMappingURL=wordle6-game-state-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.d.ts","sourceRoot":"","sources":["../../../../../src/types/documents/wordle6-game-state-document/wordle6-game-state-document.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,UAAU,EAAE,IAAI,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,4 +4,8 @@ export declare const WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
4
4
  export declare const WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
5
5
  export declare const WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
6
6
  export declare const WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
7
+ export declare const WORDLE6_GAMES_COLLECTION_PATH = "wordle6_games";
8
+ export declare const WORDLE6_LEADERBOARD_COLLECTION_PATH = "wordle6_leaderboard";
9
+ export declare const WORDLE6_MONTHLY_SCORES_COLLECTION_PATH = "wordle6_monthly_scores";
10
+ export declare const WORDLE6_SCORES_COLLECTION_PATH = "wordle6_scores";
7
11
  //# sourceMappingURL=collections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/constants/collections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kBAAkB,CAAC"}
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/constants/collections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,mCAAmC,wBAAwB,CAAC;AACzE,eAAO,MAAM,sCAAsC,2BAA2B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,mBAAmB,CAAC"}
@@ -4,3 +4,7 @@ export const WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
4
4
  export const WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
5
5
  export const WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
6
6
  export const WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
7
+ export const WORDLE6_GAMES_COLLECTION_PATH = "wordle6_games";
8
+ export const WORDLE6_LEADERBOARD_COLLECTION_PATH = "wordle6_leaderboard";
9
+ export const WORDLE6_MONTHLY_SCORES_COLLECTION_PATH = "wordle6_monthly_scores";
10
+ export const WORDLE6_SCORES_COLLECTION_PATH = "wordle6_scores";
@@ -0,0 +1,4 @@
1
+ import type { Wordle6GameStateDocument } from "../../types/documents/wordle6-game-state-document/wordle6-game-state-document.js";
2
+ import { type FirestoreDataConverter } from "firebase-admin/firestore";
3
+ export declare const wordle6GameStateDocumentConverter: FirestoreDataConverter<Wordle6GameStateDocument>;
4
+ //# sourceMappingURL=wordle6-game-state-document.converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.converter.d.ts","sourceRoot":"","sources":["../../../../src/convertors/node/wordle6-game-state-document.converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AAC7H,OAAO,EAEL,KAAK,sBAAsB,EAI5B,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,iCAAiC,EAAE,sBAAsB,CAAC,wBAAwB,CAyB5F,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Timestamp, } from "firebase-admin/firestore";
2
+ export const wordle6GameStateDocumentConverter = {
3
+ toFirestore: (doc) => {
4
+ const { _id, ...docWithoutId } = doc;
5
+ return {
6
+ ...docWithoutId,
7
+ updated_at: docWithoutId.updated_at instanceof Date
8
+ ? Timestamp.fromDate(docWithoutId.updated_at)
9
+ : docWithoutId.updated_at,
10
+ };
11
+ },
12
+ fromFirestore: (snapshot) => {
13
+ const data = snapshot.data();
14
+ return {
15
+ _id: snapshot.id,
16
+ ...data,
17
+ updated_at: data.updated_at.toDate(),
18
+ };
19
+ },
20
+ };
@@ -0,0 +1,4 @@
1
+ import type { Wordle6GameStateDocument } from "../../types/documents/wordle6-game-state-document/wordle6-game-state-document.js";
2
+ import { type FirestoreDataConverter } from "firebase/firestore";
3
+ export declare const wordle6GameStateDocumentConverter: FirestoreDataConverter<Wordle6GameStateDocument>;
4
+ //# sourceMappingURL=wordle6-game-state-document.converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.converter.d.ts","sourceRoot":"","sources":["../../../../src/convertors/web/wordle6-game-state-document.converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AAC7H,OAAO,EAEL,KAAK,sBAAsB,EAI5B,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,iCAAiC,EAAE,sBAAsB,CAAC,wBAAwB,CA2B5F,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Timestamp, } from "firebase/firestore";
2
+ export const wordle6GameStateDocumentConverter = {
3
+ toFirestore: (doc) => {
4
+ const { _id, ...docWithoutId } = doc;
5
+ return {
6
+ ...docWithoutId,
7
+ updated_at: docWithoutId.updated_at instanceof Date
8
+ ? Timestamp.fromDate(docWithoutId.updated_at)
9
+ : docWithoutId.updated_at,
10
+ };
11
+ },
12
+ fromFirestore: (snapshot) => {
13
+ const data = snapshot.data();
14
+ return {
15
+ _id: snapshot.id,
16
+ ...data,
17
+ updated_at: data.updated_at.toDate(),
18
+ };
19
+ },
20
+ };
@@ -0,0 +1,3 @@
1
+ import type { WordleGameState } from "../../types/fields/wordle-game-state/wordle-game-state.js";
2
+ export declare function reconstructGameState(guesses: string[], correctWord: string, maxRows: number): WordleGameState;
3
+ //# sourceMappingURL=reconstruct-game-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconstruct-game-state.d.ts","sourceRoot":"","sources":["../../../../src/helpers/worlde/reconstruct-game-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,uDAAuD,CAAC;AAE/D,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,eAAe,CAcjB"}
@@ -0,0 +1,48 @@
1
+ export function reconstructGameState(guesses, correctWord, maxRows) {
2
+ const wordLength = correctWord.length;
3
+ const rows = [];
4
+ for (const guess of guesses) {
5
+ const row = evaluateGuess(guess, correctWord);
6
+ rows.push(row);
7
+ }
8
+ while (rows.length < maxRows) {
9
+ rows.push(createEmptyRow(wordLength));
10
+ }
11
+ return rows;
12
+ }
13
+ function evaluateGuess(guess, correctWord) {
14
+ const row = Array.from({ length: guess.length }, () => ({
15
+ character: "",
16
+ isCorrect: false,
17
+ isLocked: true,
18
+ }));
19
+ const correctWordCounts = {};
20
+ for (const char of correctWord) {
21
+ correctWordCounts[char] = (correctWordCounts[char] || 0) + 1;
22
+ }
23
+ const markedCounts = {};
24
+ for (let i = 0; i < guess.length; i++) {
25
+ row[i].character = guess[i];
26
+ if (guess[i] === correctWord[i]) {
27
+ row[i].isCorrect = true;
28
+ markedCounts[guess[i]] = (markedCounts[guess[i]] || 0) + 1;
29
+ }
30
+ }
31
+ for (let i = 0; i < guess.length; i++) {
32
+ if (!row[i].isCorrect && correctWord.includes(guess[i])) {
33
+ markedCounts[guess[i]] = (markedCounts[guess[i]] || 0) + 1;
34
+ if (markedCounts[guess[i]] <= correctWordCounts[guess[i]]) {
35
+ row[i].isPresent = true;
36
+ }
37
+ }
38
+ }
39
+ return row;
40
+ }
41
+ function createEmptyRow(wordLength) {
42
+ return Array.from({ length: wordLength }, () => ({
43
+ character: "",
44
+ isCorrect: false,
45
+ isPresent: false,
46
+ isLocked: false,
47
+ }));
48
+ }
@@ -0,0 +1,6 @@
1
+ import type { Timestamp } from "firebase-admin/firestore";
2
+ import type { Wordle6GameStateDocumentFirestoreBase } from "../../../../types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js";
3
+ export type Wordle6GameStateDocumentFirestore = Wordle6GameStateDocumentFirestoreBase & {
4
+ updated_at: Timestamp;
5
+ };
6
+ //# sourceMappingURL=wordle6-game-state-document-firestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document-firestore.d.ts","sourceRoot":"","sources":["../../../../../../src/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AAEzJ,MAAM,MAAM,iCAAiC,GAC3C,qCAAqC,GAAG;IACtC,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Timestamp } from "firebase/firestore";
2
+ import type { Wordle6GameStateDocumentFirestoreBase } from "../../../../types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js";
3
+ export type Wordle6GameStateDocumentFirestore = Wordle6GameStateDocumentFirestoreBase & {
4
+ updated_at: Timestamp;
5
+ };
6
+ //# sourceMappingURL=wordle6-game-state-document-firestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document-firestore.d.ts","sourceRoot":"","sources":["../../../../../../src/types/documents/wordle6-game-state-document/web/wordle6-game-state-document-firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AAEzJ,MAAM,MAAM,iCAAiC,GAC3C,qCAAqC,GAAG;IACtC,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type Wordle6GameStateDocumentFirestoreBase = {
2
+ guesses: string[];
3
+ has_finished: boolean;
4
+ has_lost: boolean;
5
+ has_won: boolean;
6
+ number_of_tries_needed: number;
7
+ user_id: string;
8
+ };
9
+ //# sourceMappingURL=wordle6-game-state-document-firestore-base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document-firestore-base.d.ts","sourceRoot":"","sources":["../../../../../src/types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qCAAqC,GAAG;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export type Wordle6GameStateDocument = {
2
+ _id: string;
3
+ guesses: string[];
4
+ has_finished: boolean;
5
+ has_lost: boolean;
6
+ has_won: boolean;
7
+ number_of_tries_needed: number;
8
+ updated_at: Date;
9
+ user_id: string;
10
+ };
11
+ //# sourceMappingURL=wordle6-game-state-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.d.ts","sourceRoot":"","sources":["../../../../../src/types/documents/wordle6-game-state-document/wordle6-game-state-document.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,UAAU,EAAE,IAAI,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -4,4 +4,8 @@ export declare const WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
4
4
  export declare const WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
5
5
  export declare const WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
6
6
  export declare const WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
7
+ export declare const WORDLE6_GAMES_COLLECTION_PATH = "wordle6_games";
8
+ export declare const WORDLE6_LEADERBOARD_COLLECTION_PATH = "wordle6_leaderboard";
9
+ export declare const WORDLE6_MONTHLY_SCORES_COLLECTION_PATH = "wordle6_monthly_scores";
10
+ export declare const WORDLE6_SCORES_COLLECTION_PATH = "wordle6_scores";
7
11
  //# sourceMappingURL=collections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/constants/collections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kBAAkB,CAAC"}
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/constants/collections.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAC7D,eAAO,MAAM,mCAAmC,wBAAwB,CAAC;AACzE,eAAO,MAAM,sCAAsC,2BAA2B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,mBAAmB,CAAC"}
@@ -4,3 +4,7 @@ export const WORDLE_GAMES_COLLECTION_PATH = "wordle_games";
4
4
  export const WORDLE_LEADERBOARD_COLLECTION_PATH = "wordle_leaderboard";
5
5
  export const WORDLE_MONTHLY_SCORES_COLLECTION_PATH = "wordle_monthly_scores";
6
6
  export const WORDLE_SCORES_COLLECTION_PATH = "wordle_scores";
7
+ export const WORDLE6_GAMES_COLLECTION_PATH = "wordle6_games";
8
+ export const WORDLE6_LEADERBOARD_COLLECTION_PATH = "wordle6_leaderboard";
9
+ export const WORDLE6_MONTHLY_SCORES_COLLECTION_PATH = "wordle6_monthly_scores";
10
+ export const WORDLE6_SCORES_COLLECTION_PATH = "wordle6_scores";
@@ -0,0 +1,4 @@
1
+ import type { Wordle6GameStateDocument } from "../../types/documents/wordle6-game-state-document/wordle6-game-state-document.js";
2
+ import { type FirestoreDataConverter } from "firebase-admin/firestore";
3
+ export declare const wordle6GameStateDocumentConverter: FirestoreDataConverter<Wordle6GameStateDocument>;
4
+ //# sourceMappingURL=wordle6-game-state-document.converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.converter.d.ts","sourceRoot":"","sources":["../../../../src/convertors/node/wordle6-game-state-document.converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AAC7H,OAAO,EAEL,KAAK,sBAAsB,EAI5B,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,iCAAiC,EAAE,sBAAsB,CAAC,wBAAwB,CAyB5F,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Timestamp, } from "firebase-admin/firestore";
2
+ export const wordle6GameStateDocumentConverter = {
3
+ toFirestore: (doc) => {
4
+ const { _id, ...docWithoutId } = doc;
5
+ return {
6
+ ...docWithoutId,
7
+ updated_at: docWithoutId.updated_at instanceof Date
8
+ ? Timestamp.fromDate(docWithoutId.updated_at)
9
+ : docWithoutId.updated_at,
10
+ };
11
+ },
12
+ fromFirestore: (snapshot) => {
13
+ const data = snapshot.data();
14
+ return {
15
+ _id: snapshot.id,
16
+ ...data,
17
+ updated_at: data.updated_at.toDate(),
18
+ };
19
+ },
20
+ };
@@ -0,0 +1,4 @@
1
+ import type { Wordle6GameStateDocument } from "../../types/documents/wordle6-game-state-document/wordle6-game-state-document.js";
2
+ import { type FirestoreDataConverter } from "firebase/firestore";
3
+ export declare const wordle6GameStateDocumentConverter: FirestoreDataConverter<Wordle6GameStateDocument>;
4
+ //# sourceMappingURL=wordle6-game-state-document.converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document.converter.d.ts","sourceRoot":"","sources":["../../../../src/convertors/web/wordle6-game-state-document.converter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8EAA8E,CAAC;AAC7H,OAAO,EAEL,KAAK,sBAAsB,EAI5B,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,iCAAiC,EAAE,sBAAsB,CAAC,wBAAwB,CA2B5F,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Timestamp, } from "firebase/firestore";
2
+ export const wordle6GameStateDocumentConverter = {
3
+ toFirestore: (doc) => {
4
+ const { _id, ...docWithoutId } = doc;
5
+ return {
6
+ ...docWithoutId,
7
+ updated_at: docWithoutId.updated_at instanceof Date
8
+ ? Timestamp.fromDate(docWithoutId.updated_at)
9
+ : docWithoutId.updated_at,
10
+ };
11
+ },
12
+ fromFirestore: (snapshot) => {
13
+ const data = snapshot.data();
14
+ return {
15
+ _id: snapshot.id,
16
+ ...data,
17
+ updated_at: data.updated_at.toDate(),
18
+ };
19
+ },
20
+ };
@@ -0,0 +1,3 @@
1
+ import type { WordleGameState } from "../../types/fields/wordle-game-state/wordle-game-state.js";
2
+ export declare function reconstructGameState(guesses: string[], correctWord: string, maxRows: number): WordleGameState;
3
+ //# sourceMappingURL=reconstruct-game-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconstruct-game-state.d.ts","sourceRoot":"","sources":["../../../../src/helpers/worlde/reconstruct-game-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,uDAAuD,CAAC;AAE/D,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,eAAe,CAcjB"}
@@ -0,0 +1,48 @@
1
+ export function reconstructGameState(guesses, correctWord, maxRows) {
2
+ const wordLength = correctWord.length;
3
+ const rows = [];
4
+ for (const guess of guesses) {
5
+ const row = evaluateGuess(guess, correctWord);
6
+ rows.push(row);
7
+ }
8
+ while (rows.length < maxRows) {
9
+ rows.push(createEmptyRow(wordLength));
10
+ }
11
+ return rows;
12
+ }
13
+ function evaluateGuess(guess, correctWord) {
14
+ const row = Array.from({ length: guess.length }, () => ({
15
+ character: "",
16
+ isCorrect: false,
17
+ isLocked: true,
18
+ }));
19
+ const correctWordCounts = {};
20
+ for (const char of correctWord) {
21
+ correctWordCounts[char] = (correctWordCounts[char] || 0) + 1;
22
+ }
23
+ const markedCounts = {};
24
+ for (let i = 0; i < guess.length; i++) {
25
+ row[i].character = guess[i];
26
+ if (guess[i] === correctWord[i]) {
27
+ row[i].isCorrect = true;
28
+ markedCounts[guess[i]] = (markedCounts[guess[i]] || 0) + 1;
29
+ }
30
+ }
31
+ for (let i = 0; i < guess.length; i++) {
32
+ if (!row[i].isCorrect && correctWord.includes(guess[i])) {
33
+ markedCounts[guess[i]] = (markedCounts[guess[i]] || 0) + 1;
34
+ if (markedCounts[guess[i]] <= correctWordCounts[guess[i]]) {
35
+ row[i].isPresent = true;
36
+ }
37
+ }
38
+ }
39
+ return row;
40
+ }
41
+ function createEmptyRow(wordLength) {
42
+ return Array.from({ length: wordLength }, () => ({
43
+ character: "",
44
+ isCorrect: false,
45
+ isPresent: false,
46
+ isLocked: false,
47
+ }));
48
+ }
@@ -0,0 +1,6 @@
1
+ import type { Timestamp } from "firebase-admin/firestore";
2
+ import type { Wordle6GameStateDocumentFirestoreBase } from "../../../../types/documents/wordle6-game-state-document/wordle6-game-state-document-firestore-base.js";
3
+ export type Wordle6GameStateDocumentFirestore = Wordle6GameStateDocumentFirestoreBase & {
4
+ updated_at: Timestamp;
5
+ };
6
+ //# sourceMappingURL=wordle6-game-state-document-firestore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordle6-game-state-document-firestore.d.ts","sourceRoot":"","sources":["../../../../../../src/types/documents/wordle6-game-state-document/node/wordle6-game-state-document-firestore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AAEzJ,MAAM,MAAM,iCAAiC,GAC3C,qCAAqC,GAAG;IACtC,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC"}