[Snyk] Upgrade chess.js from 1.0.0-alpha.0 to 1.0.0 #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade chess.js from 1.0.0-alpha.0 to 1.0.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 11 versions ahead of your current version.
The recommended version was released 23 days ago.
Release notes
Package name: chess.js
-
1.0.0 - 2025-01-11
- The
- The
- The
- Change
- Change
- Change
- Allow the user to omit castling rights, en passant square, and move numbers when calling
- Add
- Validate king presence in
- Allow spaces between the bracket and tag in PGN header (@ jhlywa - 5f48a68)
- Allow user to specify a promotion piece (when supplying a verbose move) even if the move is not a promotion (@ jhlywa - 8e71084)
- Add
- Add removeHeader method (@ angarc - #388)
- Fixed moves() when there are no kings (@ neofight78 - #386)
- Handle captures with missing ‘x’ (@ neofight78 - #385)
- Add methods for getting/setting castling rights (
- Ensure put/remove functions update ep square (@ neofight78 - #398 )
- Make
- Add support for both ESM and CommonJS environments (@ jorgecasar - #406)
- Add check for invalid pawn placement in validateFen (@ Manukyanq - #412)
- Update castling rights and en passant square in
- Add
- Add
- Add type annotations (@ HarshilPatel007 - #478)
- Fix
- Fix
- Remove
- Add missing
- Fix type of Move.from and Move.to fields (@ MichaelTamm - #371)
- Fix major esm inconsistency (@ GabrielDelepine - #374)
- Add optional piece argument to .moves() (@ ChrisAntley1 - #378)
- Fix README shield links (@ JamJomJim - #416)
- Fix three-fold repetition to only return true if the immediate position has been repeated 3 times (@ gavin-lb - #144)
- Update internal king cache when overwriting the king via
- Always clear Setup and FEN when calling .clear() (@ jhlywa - be03fe0)
- Fix positionCount bug when stored in a pinia Vue store (@ jhlywa - c1909fe)
-
1.0.0-beta.9 - 2025-01-11
-
1.0.0-beta.8 - 2024-02-24
-
1.0.0-beta.7 - 2023-12-17
- Add check for invalid pawn placement in validateFen (@ Manukyanq - #412)
- Update castling rights and en passant square in
- Add
- Fix README shield links (@ JamJomJim - #416)
- Fix three-fold repetition to only return true if the immediate position has been repeated 3 times (@ gavin-lb - #144)
- Update internal king cache when overwriting the king via
- Always clear Setup and FEN when calling .clear() (@ jhlywa - be03fe0)
-
1.0.0-beta.6 - 2023-05-16
- Add methods for getting/setting castling rights (
- Ensure put/remove functions update ep square (@ neofight78 - #398 )
- Make
- Add support for both ESM and CommonJS environments (@ jorgecasar - #406)
-
1.0.0-beta.5 - 2023-04-18
- Add removeHeader method (@ angarc - #388)
- Fixed moves() when there are no kings (@ neofight78 - #386)
- Handle captures with missing ‘x’ (@ neofight78 - #385)
- Add methods for getting/setting castling rights (@ neofight78 - #387)
- Revert module type to CommonJS (@ jhlywa)
-
1.0.0-beta.4 - 2023-03-18
- Add
- #378 Add optional piece argument to .moves() (@ ChrisAntley1)
-
1.0.0-beta.3 - 2023-02-03
- #374 Fix major esm inconsistency (@ GabrielDelepine )
-
1.0.0-beta.2 - 2023-01-19
- #371 Fix type of Move.from and Move.to fields (@ MichaelTamm)
-
1.0.0-beta.1 - 2023-01-15
- Remove
- Add
-
1.0.0-beta.0 - 2023-01-14
-
1.0.0-alpha.0 - 2022-09-05
from chess.js GitHub release notesv1.0.0
A big thank you to all the contributors that helped make this release possible! This is a major version update and there are many new features and breaking changes. Please read below for more info.
Typescript
chess.js has been rewritten in TypeScript. Exported types are as follows:
ChessclassMoveclassPieceColorSquarePieceSymbolNew Methods
attackers(square, color)- returns a list of squares occupied by pieces ofcolorthat are attacking the givensquaregetCastlingRights(color)- returns{ k: boolean, q: boolean }indicating castling rights forcolorsetCastlingRights(color, rights)isAttacked(square, color)- returns true ifsquareis attacked bycolorisDrawByFiftyMoves()moveNumber()setHeader(key, value),removeHeader(key),getHeaders()removeComment(),removeComments()Breaking Changes
Exceptions instead of
nullThe following functions no longer return
nullwhen an error occurs. Instead, they now throw exceptions to provide the user with more detailed error information..load().loadPgn().move()Chess()constructorFunction Names
The functions below have been converted to camel-case:
game_over->isGameOverin_check->isCheckin_checkmate->isCheckmatein_draw->isDrawis_stalemate->isStalematein_threefold_repetition->isThreefoldRepetitioninsufficient_material->isInsufficientMaterialload_pgn->loadPgnset_comment->setCommentget_comment->getCommentget_comments->getCommentsdelete_comment->deleteCommentdelete_comments->deleteCommentsvalidate_fen->validateFenFunction Arguments and Return Values
The arguments and return values for the following functions have changed:
load_pgn(pgn, { sloppy: true })becomesloadPgn(pgn)(strictdefaults tofalse)move('Nb7', { sloppy: true })becomesmoves('Nb7')clear(true)should now be written asclear({ preserveHeader: true })load(fen, true)should now be written asload(fen, { preserveHeader: true })validateFen(fen)now returns{ ok: boolean, error?: string }Deprecations
flagsfield in the Move object is deprecated. Use the new helper methods below to determine the move type:.isCapture()- is the move a regular capture? NOTE: this isfalsefor an en-passant.isEnPassant()- is the move an en-passant capture?.isBigPawn()- is the move a 2-rank pawn move?.isPromotion()- is the move a pawn promotion?.isKingsideCastle()- is the move a kingside castle?.isQueensideCastle()- is the move a queenside castle?headerfunction has been deprecated in favor ofsetHeaderandgetHeadersdeleteCommentanddeleteCommentsfunctions have deprecated in favor ofremoveCommentandremoveCommentsImprovements
.loadto throw an exception when loading invalid FEN (@ jhlywa - ac977ed ).moveto throw an exception on illegal move (@ jhlywa - 8523db8).loadPgnto throw an exception when encountered error (@ jhlywa - #TODO).load(@ jhlywa - 8523db8)isAttackedto determine attackers of a specific square (@ jhlywa - 9b49454)validateFen(@ jhlywa - a137478)beforeandafterFEN to Move object (@ jhlywa - d42b0)getCastlingRights,setCastlingRights) (@ neofight78 - 7cb2d34)moveNumberaccessible (@ neofight78 - #399).put()(@ gavin-lb - 55181a9)skipValidationoption to.load(@ jhlywa - e2ff91c)isDrawByFiftyMoves(@ HarshilPatel007 - #477)Bug Fixes
loadPgn()to handle PGN without any moves (@ jhlywa - d12f78f)pgn()export when comment precedes black to move (@ jhlywa - 4fd6069)postinstallscript (@ jhlywa - 495d37)"types": "dist/chess.d.ts"entry to package.json (@ jhlywa - 495d37f)put()(@ Manukyanq #426)1.0.0-beta.9
1.0.0-beta.8
Breaking Changes
These two changes only impact users that retain PGN headers when calling
.clearor.load.clear(true)should now be written asclear({ preserveHeader: true })load(myFen, true)should now be written asload(myFen, { preserveHeader: true })Enhancements
.put()(@ gavin-lb - 55181a9)skipValidationoption to.load(@ jhlywa - e2ff91c)Bug Fixes
put()(@ Manukyanq #426)Enhancements
getCastlingRights,setCastlingRights) (@ neofight78 - 7cb2d34)moveNumberaccessible (@ neofight78 - #399)Enhancements
Bug Fixes
Enhancements
beforeandafterFEN to Move object (@ jhlywa)Bug Fixes
Bug Fixes
Bug Fixes
Bug Fixes
postinstallscript"types": "dist/chess.d.ts"entry to package.jsonImportant
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: