4402e2699cc64974c2e6550edd1bb0c05d4146b8
[vchess.git] / client / src / utils / notation.js
1 // Take into account that the move may be a multi-move
2 export function getFullNotation(move, type) {
3 if (!type) type = "notation";
4 if (Array.isArray(move)) {
5 let notation = "";
6 for (let i=0; i<move.length; i++)
7 notation += move[i][type] + ",";
8 // Remove last comma:
9 return notation.slice(0,-1);
10 }
11 // Simple (usual) case
12 return move[type];
13 }