X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Futils%2FsquareId.js;h=58ca08625e484dbc9b0c5f996e74bcb7270fe118;hp=6469bc3f86f50b4de5a1ce6759804485a35070e7;hb=6808d7a16ec1e761c6a2dffec2281c96953e4d89;hpb=ae2c49bb0bbaac3953f63be5b720e9c6835f00b6 diff --git a/client/src/utils/squareId.js b/client/src/utils/squareId.js index 6469bc3f..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) -{ +export function getSquareId(o) { // 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 -export function getSquareFromId(id) -{ - const idParts = id.split('-'); +export function getSquareFromId(id) { + const idParts = id.split("-"); return [parseInt(idParts[1]), parseInt(idParts[2])]; }