chess-moments 0.8.0 → 0.8.2
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.
- package/functions/make-moments.js +1 -1
- package/functions/parser.js +1 -3
- package/package.json +2 -2
|
@@ -26,7 +26,7 @@ const make = (sloppyPgn) => {
|
|
|
26
26
|
store.depth = depth;
|
|
27
27
|
|
|
28
28
|
// parse current moves with the computed FEN
|
|
29
|
-
const moments = parser(moves, store.fen, depth);
|
|
29
|
+
const moments = parser(chess, moves, store.fen, depth);
|
|
30
30
|
|
|
31
31
|
// set history for the current depth
|
|
32
32
|
history.set(depth, fen.history(moments, history, depth));
|
package/functions/parser.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
const { Chess } = require('chess.js');
|
|
2
1
|
const { initial } = require('./fen');
|
|
3
2
|
const pgn = require('./pgn');
|
|
4
3
|
const moment = require('./moment');
|
|
5
4
|
|
|
6
|
-
module.exports = (moves, fen = initial, depth = 1) => {
|
|
7
|
-
const chess = new Chess();
|
|
5
|
+
module.exports = (chess, moves, fen = initial, depth = 1) => {
|
|
8
6
|
const loaded = chess.load_pgn(pgn.build(moves, fen));
|
|
9
7
|
if (!loaded) {
|
|
10
8
|
return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chess-moments",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "PGN reader is a javascript chess library that transforms PGN files into chess moments",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"chai": "^4.2.0",
|
|
31
31
|
"eslint": "^7.5.0",
|
|
32
|
-
"lodash": "^4.17.
|
|
32
|
+
"lodash": "^4.17.21",
|
|
33
33
|
"mocha": "^8.1.1",
|
|
34
34
|
"prettier": "^2.0.5"
|
|
35
35
|
}
|