Fix parseInt() usage, rename Doubleorda --> Ordamirror, implement Clorange variant
[vchess.git] / client / src / utils / squareId.js
index a68b51f..a54f1a5 100644 (file)
@@ -1,13 +1,11 @@
 // Get the identifier of a HTML square from its numeric coordinates o.x,o.y.
-export function getSquareId(o)
-{
-       // NOTE: a separator is required to allow any size of board
-       return  "sq-" + o.x + "-" + o.y;
+export function getSquareId(o) {
+  // NOTE: a separator is required to allow any size of board
+  return "sq-" + o.x + "-" + o.y;
 }
 
 // Inverse function
-export function getSquareFromId(id)
-{
-       const idParts = id.split('-');
-       return [parseInt(idParts[1]), parseInt(idParts[2])];
+export function getSquareFromId(id) {
+  const idParts = id.split("-");
+  return [parseInt(idParts[1], 10), parseInt(idParts[2], 10)];
 }