New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@chess-fu/chess-game

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chess-fu/chess-game - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

24

dist/src/chessGame.js

@@ -656,5 +656,20 @@ "use strict";

var isLegal = false;
var targetIx = chessUtils_1.offsetToIndex(move);
var restore = [targetIx, this._board[targetIx], squareIx, this._board[squareIx]];
this._board[squareIx] = constants_1.NONE;
var targetIx = chessUtils_1.offsetToIndex(move);
var saved = this._board[targetIx];
if (this._enpass >= 0 && move.enpass) {
var killSquare = chessUtils_1.offsetToIndex({ y: move.y === 2 ? move.y + 1 : move.y - 1, x: move.x });
restore.push(killSquare, this._board[killSquare]);
this._board[killSquare] = constants_1.NONE;
}
else if (move.castle && move.castle in INDEXES) {
var castleIx = INDEXES[move.castle];
var rookPiece = (this._turn === constants_1.WHITE ? constants_1.ROOK.toUpperCase() : constants_1.ROOK);
var queenSide = move.castle < move.from;
var rookToIx = targetIx + (queenSide ? 1 : -1);
restore.push(castleIx, this._board[castleIx]);
restore.push(rookToIx, this._board[rookToIx]);
this._board[castleIx] = constants_1.NONE;
this._board[rookToIx] = rookPiece;
}
try {

@@ -679,4 +694,5 @@ this._board[targetIx] = movingPiece;

finally {
this._board[targetIx] = saved;
this._board[squareIx] = movingPiece;
for (var ix = 0; ix < restore.length; ix += 2) {
this._board[restore[ix]] = restore[ix + 1];
}
this._whiteKing = _whiteKing;

@@ -683,0 +699,0 @@ this._blackKing = _blackKing;

2

package.json
{
"name": "@chess-fu/chess-game",
"access": "public",
"version": "1.1.2",
"version": "1.1.3",
"description": "Chess game logic",

@@ -6,0 +6,0 @@ "author": "chess-fu.com",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc