Skip to content

Commit

Permalink
update debugstate
Browse files Browse the repository at this point in the history
  • Loading branch information
JollyGrin committed Sep 13, 2024
1 parent d5f6bc9 commit 479eab7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/helpers/debugState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { GameState } from "@/types/card";
* Having trouble understanding the state?
* Throw this around state anywhere to see a table in the console logs
* */
function debugState(state: GameState) {
export function debugState(state: GameState) {
// Transform each row into an object that includes the `id` from each object
const arrayOfObjects = state.map((row, rowIndex) => {
// Start with the row name from the enum
const rowObject = { "Row Name": GRIDS[rowIndex] };

// Add the id from each object in the row
row.forEach((obj, colIndex) => {
//@ts-ignore: do not care, it works
//@ts-expect-error: do not care, it works
rowObject[`Card Index ${colIndex}`] = obj.id;
});

Expand Down

0 comments on commit 479eab7

Please sign in to comment.