Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoBSalgueiro committed Feb 7, 2024
1 parent ccd1a86 commit 1650aa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pgn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ test('parse comment', () => {
text: '',
emt: 4.3,
evaluation: { mate: 35, depth: 33 },
shapes: []
shapes: [],
});
expect(parseComment('-0.32/24 1.0s, White loses on time')).toEqual({
emt: 1.0,
Expand All @@ -249,7 +249,7 @@ test('parse comment', () => {
emt: 0.003,
evaluation: { mate: 1, depth: 245 },
text: 'nodes,9071, seldepth, 2, nps, 2267750, Komodo got checkmated',
shapes: []
shapes: [],
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/pgn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,9 +834,9 @@ export const parseComment = (comment: string): Comment => {
/\s?(?:([+-]?M\d{1,5})|([+-]?(?:\d{1,5}|\d{0,5}\.\d{1,2})))(?:\/(\d{1,5}))?,?(?:\s(\d{1,5}\.\d{1,3})s),?\s?/g,
(_, mate, pawns, d, e) => {
const depth = d && parseInt(d, 10);
evaluation = mate ? { mate: parseInt(mate.replace("M", ""), 10), depth } : { pawns: parseFloat(pawns), depth };
evaluation = mate ? { mate: parseInt(mate.replace('M', ''), 10), depth } : { pawns: parseFloat(pawns), depth };
if (e) {
emt = parseFloat(e)
emt = parseFloat(e);
}
return ' ';
},
Expand Down

0 comments on commit 1650aa2

Please sign in to comment.