From cac16b2acebf94e07402e6c050f7f3647f16d1b0 Mon Sep 17 00:00:00 2001 From: GuillaumeSD Date: Sun, 18 May 2025 23:41:21 +0200 Subject: [PATCH] fix : tsc down compiling --- src/lib/chess.ts | 2 +- src/sections/analysis/hooks/useCurrentPosition.ts | 2 +- tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/chess.ts b/src/lib/chess.ts index 3989694..4b9130a 100644 --- a/src/lib/chess.ts +++ b/src/lib/chess.ts @@ -60,7 +60,7 @@ export const setGameHeaders = ( game.setHeader("Site", "Chesskit.org"); game.setHeader( "Date", - new Date().toISOString().split("T")[0].replaceAll("-", ".") + new Date().toISOString().split("T")[0].replace(/-/g, ".") ); const { white, black, resigned } = params; diff --git a/src/sections/analysis/hooks/useCurrentPosition.ts b/src/sections/analysis/hooks/useCurrentPosition.ts index 61bcc77..257be3f 100644 --- a/src/sections/analysis/hooks/useCurrentPosition.ts +++ b/src/sections/analysis/hooks/useCurrentPosition.ts @@ -60,7 +60,7 @@ export const useCurrentPosition = (engine: UciEngine | null) => { } if (!position.eval?.opening) { - for (const move of boardHistory.toReversed()) { + for (const move of boardHistory.slice().reverse()) { const moveFen = move.after.split(" ")[0]; const opening = openings.find((opening) => opening.fen === moveFen); if (opening) { diff --git a/tsconfig.json b/tsconfig.json index 3ddcd2d..11341e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ES2017", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": ["dom"], "allowJs": false, "skipLibCheck": true, "strict": true,