forked from shaack/cm-chess
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When I tried to compile the repo, I got the following error messages:
> tsc
src/History.ts:441:9 - error TS18048: 'from' is possibly 'undefined'.
441 if (from.type !== KING || from.color !== chess.turn()) {
~~~~
src/History.ts:441:31 - error TS18048: 'from' is possibly 'undefined'.
441 if (from.type !== KING || from.color !== chess.turn()) {
~~~~
src/History.ts:446:12 - error TS18048: 'to' is possibly 'undefined'.
446 return to.type === KING && to.color !== chess.turn();
~~
src/History.ts:446:32 - error TS18048: 'to' is possibly 'undefined'.
446 return to.type === KING && to.color !== chess.turn();
~~
src/History.ts:484:21 - error TS2740: Type '{ color: Color; from: Square; to: Square; piece: "k"; flags: string; san: string; lan: string; before: string; after: string; }' is missing the following properties from type 'Move': isCapture, isPromotion, isEnPassant, isKingsideCastle, and 2 more.
484 return {
~~~~~~
Found 5 errors in the same file, starting at: src/History.ts:441
> tsc --version
Version 5.7.3Metadata
Metadata
Assignees
Labels
No labels