Skip to content

Commit 6d30113

Browse files
committed
chore: Use sheets-parser with new types!
1 parent 3578d9a commit 6d30113

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"ps-client": "^4.5.3",
3737
"react": "^18.2.0",
3838
"react-dom": "^18.2.0",
39-
"sheets-parser": "^1.0.1",
39+
"sheets-parser": "^1.1.0",
4040
"tailwindcss": "^4.0.8",
4141
"ts-loader": "^9.5.2",
4242
"ts-node": "^10.9.2",

src/cache/pokemonGo.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { FlatCache } from 'flat-cache';
2-
// @ts-expect-error -- TODO: Add native types for sheets-parser
32
import SheetsParser from 'sheets-parser';
43

54
import { IS_ENABLED } from '@/enabled';
@@ -85,11 +84,11 @@ if (cachedChargedMoves) GOData.chargedMoves = cachedChargedMoves;
8584

8685
export async function updatePokemonGOCache(): Promise<void> {
8786
if (!client) throw new Error('Reading data from Google Sheets is disabled.');
88-
const data: {
87+
const data = await client.getDataFromSheet<{
8988
pokedex: Record<string, PokemonGO.Pokemon>;
9089
fast_moves: Record<string, PokemonGO.FastMove>;
9190
charged_moves: Record<string, PokemonGO.ChargedMove>;
92-
} = await client.getDataFromSheet(POKEMON_GO_SOURCE_SHEET_ID, ['#pokedex', '#fast_moves', '#charged_moves']);
91+
}>(POKEMON_GO_SOURCE_SHEET_ID, ['#pokedex', '#fast_moves', '#charged_moves']);
9392

9493
flatCache.set('pokedex', data.pokedex);
9594
flatCache.set('fastMoves', data.fast_moves);

0 commit comments

Comments
 (0)