Private
Public Access
1
0

chg: pkg: make a massive refactor to the backend and remove all unnecessary deps - and make small refactors for the frontend too #4

This commit is contained in:
2026-04-09 20:21:01 +02:00
parent 23547f4237
commit b55c223d8a
55 changed files with 1567 additions and 4398 deletions

View File

@@ -24,11 +24,7 @@ class Grid extends React.Component {
createSet(obj) {
for (let i = 0, j = this.state.row * this.state.col; i < j; i++) {
obj.push(
0 < this.state.mines
? 'm'
: 'w',
);
obj.push(0 < this.state.mines ? 'm' : 'w');
this.state.mines--;
}
@@ -61,15 +57,8 @@ class Grid extends React.Component {
return grid;
}
checkMine(field, i, j) {
return 'undefined' !== typeof field[i] && 'undefined' !== typeof field[i][j] && 'm' === field[i][j];
}
isThereMine(obj, row, col) {
if (this.checkMine(obj, row, col)) {
return 1;
}
return 0;
return 'm' === obj?.[row]?.[col] ? 1 : 0;
}
numberingGrid(obj) {