X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2FsquareId.js;h=58ca08625e484dbc9b0c5f996e74bcb7270fe118;hb=077ba3446c4ea3c6553c325fc8d16a96b7a9ff4f;hp=a68b51f9e6d002f5963253768b3741160e6a6c6b;hpb=8d61fc4ab7373b4a576f3f9108cdf7768ae27096;p=vchess.git diff --git a/client/src/utils/squareId.js b/client/src/utils/squareId.js index a68b51f9..58ca0862 100644 --- 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. -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]), parseInt(idParts[2])]; }