<commit_before>import m from 'mithril';
import classNames from 'classnames';

// The area of the game UI that displays each player's current score
var ScoreboardComponent = {};

ScoreboardComponent.view = function (vnode) {
  var game = vnode.attrs.game;
  return m('div#game-scoreboard', game.players.map(function (player) {
    return m('div.player-stats', {class: classNames(player.color)}, [
      m('div.player-name', player.name),
      m('div.player-score', player.score)
    ]);
  }));
};

export default ScoreboardComponent;<commit_msg>Convert scoreboard component to ES6 class<commit_after>import m from 'mithril';
import classNames from 'classnames';

// The area of the game UI that displays each player's current score
class ScoreboardComponent {

  oninit(vnode) {
    this.game = vnode.attrs.game;
  }

  view() {
    return m('div#game-scoreboard', this.game.players.map(function (player) {
      return m('div.player-stats', {class: classNames(player.color)}, [
        m('div.player-name', player.name),
        m('div.player-score', player.score)
      ]);
    }));
  }

}

export default ScoreboardComponent;
{'fraction_non_alphanumeric': 0.13918439716312056, 'fraction_numerical': 0.0008865248226950354, 'mean_word_length': 3.9517543859649122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '348727', 'n_tokens_mistral': 349, 'n_tokens_neox': 343, 'n_words': 88}