From 06ddda38a19f58c80db041137158175170f97fd2 Mon Sep 17 00:00:00 2001 From: Jia-Ho Jian Date: Fri, 1 Dec 2023 02:51:14 +0800 Subject: [PATCH] fix typo --- package.json | 2 +- src/dataStructures.ts | 2 +- src/index.ts | 10 +++++----- tests/parse1.test.ts | 2 +- tests/parse2.test.ts | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 62a88f1..b43bfe7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "test": "jest" }, "name": "@canyougiant/aoe3de-replay-parser", - "version": "1.1.0", + "version": "1.1.1", "description": "Parsing Age3Yrec file of AOE3DE", "repository": { "type": "git", diff --git a/src/dataStructures.ts b/src/dataStructures.ts index cfa2852..6683bc6 100644 --- a/src/dataStructures.ts +++ b/src/dataStructures.ts @@ -42,7 +42,7 @@ export interface Player { homecityName: string, slotId: number, playerName: string, - intialDecks: Deck[], + initialDecks: Deck[], } export interface Deck { diff --git a/src/index.ts b/src/index.ts index b229495..c1b2cb6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -59,17 +59,17 @@ export function parseReplay(fileArrayBuffer: ArrayBuffer): Replay { homecityName: dictionary[`gameplayer${i}homecityname`], slotId: dictionary[`gameplayer${i}id`], playerName: dictionary[`gameplayer${i}name`], - intialDecks: [], + initialDecks: [], } players.push(player); } - // intial decks + // initial decks players.sort((a, b) => a.slotId - b.slotId); let deckIndex: number = 0; let allDecks = searchAllDecks(); for (let i = 0; i < players.length; i++) { - let intialDecks: Deck[] = []; + let initialDecks: Deck[] = []; let previousDeckId: number = allDecks[0].deckId; while (deckIndex < allDecks.length) { if (allDecks[deckIndex].deckId < previousDeckId) { @@ -78,7 +78,7 @@ export function parseReplay(fileArrayBuffer: ArrayBuffer): Replay { if (allDecks[deckIndex].deckName == '*') { break; } - intialDecks.push(allDecks[deckIndex]); + initialDecks.push(allDecks[deckIndex]); previousDeckId = allDecks[deckIndex].deckId; deckIndex++; } @@ -88,7 +88,7 @@ export function parseReplay(fileArrayBuffer: ArrayBuffer): Replay { } deckIndex++; } - players[i].intialDecks = intialDecks; + players[i].initialDecks = initialDecks; } let replay: Replay = { diff --git a/tests/parse1.test.ts b/tests/parse1.test.ts index 9136a31..c3ccb6d 100644 --- a/tests/parse1.test.ts +++ b/tests/parse1.test.ts @@ -8,6 +8,6 @@ test('adds two numbers correctly', () => { console.log(replay); expect(replay).toBeDefined(); for (let i = 0; i < replay.players.length; i++) { - expect(replay.players[i].intialDecks.length).toBeGreaterThan(0); + expect(replay.players[i].initialDecks.length).toBeGreaterThan(0); } }); \ No newline at end of file diff --git a/tests/parse2.test.ts b/tests/parse2.test.ts index ef07d56..b8a2831 100644 --- a/tests/parse2.test.ts +++ b/tests/parse2.test.ts @@ -8,6 +8,6 @@ test('adds two numbers correctly', () => { console.log(replay); expect(replay).toBeDefined(); for (let i = 0; i < replay.players.length; i++) { - expect(replay.players[i].intialDecks.length).toBeGreaterThan(0); + expect(replay.players[i].initialDecks.length).toBeGreaterThan(0); } }); \ No newline at end of file