Skip to content

Commit

Permalink
refactor: autofix issues in 3 files
Browse files Browse the repository at this point in the history
Resolved issues in the following files with DeepSource Autofix:
1. src/debug.js
2. src/gameLogic.js
3. src/Theme.js
  • Loading branch information
deepsource-autofix[bot] authored Dec 1, 2023
1 parent e1599f7 commit cc1ed56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function pieceIs(piece, color, name) {

function ThemeData(theme, options = {}) {
if (!theme.name && options.validate)
console.error(`theme not valid, info`, { theme: theme, this: this, options: options });
console.error("theme not valid, info", { theme: theme, this: this, options: options });
this.name = theme.name;
this.pieces = {
light: {},
Expand Down
2 changes: 1 addition & 1 deletion src/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as gameLogic from './gameLogic';

global.cfdlog ??= console.fdlog ??= (level, ...args) => {
if (global.uselog && global.uselog >= level)
console.log(...args);
{};
};

console.dlog ??= (...args) => global.cdlog(...args);
Expand Down
6 changes: 3 additions & 3 deletions src/gameLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ function whereCanMove(move, squares, piece, x, y, realMove) {
let tempX, tempY, count = 0;
for ([tempX, tempY] = [x, y]; isValidPosition(tempX, tempY) && ((square(tempX, tempY) === null) || !count); [tempX, tempY, count] = [tempX + dirX, tempY + dirY, count + 1])
add(tempX, tempY);
console.dlog(getLg(), 4, `testing qm tempresult log 1 / whereCanMove`, { $tempPos: [tempX, tempY], $pos: [x, y], $result: result.map(index2pos).map(obj => [obj.x, obj.y]), result: result, dir: [dirX, dirY] });
console.dlog(getLg(), 4, "testing qm tempresult log 1 / whereCanMove", { $tempPos: [tempX, tempY], $pos: [x, y], $result: result.map(index2pos).map(obj => [obj.x, obj.y]), result: result, dir: [dirX, dirY] });
addIfEmptyExt(tempX, tempY, isValidPosition(tempX, tempY));
console.dlog(getLg(), 3, `testing qm tempresult log 2 / whereCanMove`, { $pos: [x, y], $result: result.map(index2pos).map(obj => [obj.x, obj.y]), result: result, dir: [dirX, dirY] });
console.dlog(getLg(), 3, "testing qm tempresult log 2 / whereCanMove", { $pos: [x, y], $result: result.map(index2pos).map(obj => [obj.x, obj.y]), result: result, dir: [dirX, dirY] });
}
}

Expand Down Expand Up @@ -114,7 +114,7 @@ function whereCanMove(move, squares, piece, x, y, realMove) {
break;
}

console.dlog(getLg(), 3, `whereCanMove: test end`, result);
console.dlog(getLg(), 3, "whereCanMove: test end", result);

return result;
}
Expand Down

0 comments on commit cc1ed56

Please sign in to comment.