cm-chess 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Chess.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-chess",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "It's like chess.js, but in ES6 and can handle variations (tree-structured move history)",
5
5
  "main": "./src/Chess.js",
6
6
  "type": "module",
package/src/Chess.js CHANGED
@@ -294,7 +294,7 @@ export class Chess {
294
294
  * @returns {[]} the pieces (positions) at a specific move
295
295
  */
296
296
  pieces(type = undefined, color = undefined, move = this.lastMove()) {
297
- const chessJs = move ? new ChessJs(move.fen) : new ChessJs()
297
+ const chessJs = move ? new ChessJs(move.fen) : new ChessJs(this.fen())
298
298
  let result = []
299
299
  for (let i = 0; i < 64; i++) {
300
300
  const square = SQUARES[i]
@@ -322,7 +322,7 @@ export class Chess {
322
322
  * @returns {{color: any, type: any}|null}
323
323
  */
324
324
  piece(square, move = this.lastMove()) {
325
- const chessJs = move ? new ChessJs(move.fen) : new ChessJs()
325
+ const chessJs = move ? new ChessJs(move.fen) : new ChessJs(this.fen())
326
326
  return chessJs.get(square)
327
327
  }
328
328