<commit_before>(function() {
  'use strict';
  var converter = {
    s2m: function(s) {
      var minutes = Math.floor(s / 60);
      var seconds = s % 60;
      return ('0' + minutes.toString()).slice(-2) + ':' + ('0' + seconds.toString()).slice(-2);
    },
    m2s: function(m) {
      var arrayString = m.split(':');
      var minutes = Number(arrayString[0]);
      var seconds = Number(arrayString[1]);
      return minutes * 60 + seconds;
    }
  };
  Polymer({
    is: 'timer-main',
    properties: {
      time: {
        type: String,
        value: '25:00',
        notify: true
      },
      message: {
        type: String,
        value: 'This is message.',
        notify: true
      }
    },
    start: function() {
      if (this.intervalId !== void 0) {
        return;
      }

      var self = this;
      this.intervalId = setInterval(
        function(){ self.timeElapses(); },
        1000
      );
      console.debug('start - ID: ' + this.intervalId);
    },
    stop:  function() {
      if (this.intervalId === void 0) {
        return;
      }

      clearInterval(this.intervalId);
      console.debug('stop -  ID: ' + this.intervalId);
      this.intervalId = void 0;
    },
    next:  function() {
      this.stop();
      this.time = '25:00';
      this.start();
    },
    timeElapses: function() {
      var now = converter.m2s(this.time);
      this.time = converter.s2m(now - 1);
    },
    ready: function() {
      console.log(this);
    }
  });

})();<commit_msg>stop timer when time is 0.<commit_after>(function() {
  'use strict';
  var converter = {
    s2m: function(s) {
      var minutes = Math.floor(s / 60);
      var seconds = s % 60;
      return ('0' + minutes.toString()).slice(-2) + ':' + ('0' + seconds.toString()).slice(-2);
    },
    m2s: function(m) {
      var arrayString = m.split(':');
      var minutes = Number(arrayString[0]);
      var seconds = Number(arrayString[1]);
      return minutes * 60 + seconds;
    }
  };
  Polymer({
    is: 'timer-main',
    properties: {
      time: {
        type: String,
        value: '25:00',
        notify: true
      },
      message: {
        type: String,
        value: 'This is message.',
        notify: true
      }
    },
    start: function() {
      if (this.intervalId !== void 0) {
        return;
      }

      var self = this;
      this.intervalId = setInterval(
        function(){ self.timeElapses(); },
        1000
      );
      console.debug('start - ID: ' + this.intervalId);
    },
    stop:  function() {
      if (this.intervalId === void 0) {
        return;
      }

      clearInterval(this.intervalId);
      console.debug('stop -  ID: ' + this.intervalId);
      this.intervalId = void 0;
    },
    next:  function() {
      this.stop();
      this.time = '25:00';
      this.start();
    },
    timeElapses: function() {
      var now = converter.m2s(this.time) - 1;
      this.time = converter.s2m(now);

      if (now === 0) {
        this.stop();

        var title = 'PomodoroTimer';
        var message = 'Elapsed time: 00:10';
        this.message = message;
        this.notify(title, message);
        console.debug(title, message);
      }
    },
    notify: function(title, message) {
    },
    ready: function() {
      console.log(this);
    }
  });

})();
{'fraction_non_alphanumeric': 0.16389476867251285, 'fraction_numerical': 0.0211672210462655, 'mean_word_length': 1.83704974271012, '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': '492867', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1055, 'n_words': 234}