projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
loadMore button for my local games as well
[vchess.git]
/
client
/
src
/
utils
/
squareId.js
diff --git
a/client/src/utils/squareId.js
b/client/src/utils/squareId.js
index
6469bc3
..
58ca086
100644
(file)
--- a/
client/src/utils/squareId.js
+++ b/
client/src/utils/squareId.js
@@
-1,13
+1,11
@@
// Get the identifier of a HTML square from its numeric coordinates o.x,o.y.
// Get the identifier of a HTML square from its numeric coordinates o.x,o.y.
-export function getSquareId(o)
-{
+export function getSquareId(o) {
// NOTE: a separator is required to allow any size of board
// NOTE: a separator is required to allow any size of board
- return
"sq-" + o.x + "-" + o.y;
+ return "sq-" + o.x + "-" + o.y;
}
// Inverse function
}
// Inverse function
-export function getSquareFromId(id)
-{
- const idParts = id.split('-');
+export function getSquareFromId(id) {
+ const idParts = id.split("-");
return [parseInt(idParts[1]), parseInt(idParts[2])];
}
return [parseInt(idParts[1]), parseInt(idParts[2])];
}