class MoveTable { static buildScoresRows(reasoning) { const scores = reasoning && typeof reasoning === "object" ? reasoning.scores : null; const moveOrder = ["up", "down", "left", "right"]; return moveOrder.map((move) => { const hasScore = scores && typeof scores === "object" && !Array.isArray(scores) && Object.prototype.hasOwnProperty.call(scores, move); const value = hasScore ? scores[move] : "-"; return `${move}${Utils.safeString(value)}`; }).join(""); } }