lib/joinclause.js
function on(first, operator, second) {
    var data,
        bool = this._bool();
    switch (arguments.length) {
      case 1:
        {
          if (typeof first === 'object' && typeof first.toSQL !== 'function') {
            var i = -1,
                keys = Object.keys(first);
            var method = bool === 'or' ? 'orOn' : 'on';
            while (++i < keys.length) {
              this[method](keys[i], first[keys[i]]);
            }
            return this;
          } else {
            data = [bool, 'on', first];
          }
          break;
        }
      case 2:
        data = [bool, 'on', first, '=', operator];
        break;
      default:
        data = [bool, 'on', first, operator, second];
    }
    this.clauses.push(data);
    return this;
  }
function on(first, operator, second) {
    var data,
        bool = this._bool();
    switch (arguments.length) {
      case 1:
        {
          if (typeof first === 'object' && typeof first.toSQL !== 'function') {
            var i = -1,
                keys = Object.keys(first);
            var method = bool === 'or' ? 'orOn' : 'on';
            while (++i < keys.length) {
              this[method](keys[i], first[keys[i]]);
            }
            return this;
          } else {
            data = [bool, 'on', first];
          }
          break;
        }
      case 2:
        data = [bool, 'on', first, '=', operator];
        break;
      default:
        data = [bool, 'on', first, operator, second];
    }
    this.clauses.push(data);
    return this;
  }
function on ( first , operator , second ) { var data , bool = this . _bool ( ) ; switch ( arguments . length ) { case 1 : { if ( typeof first === 'object' && typeof first . toSQL !== 'function' ) { var i = - 1 , keys = Object . keys ( first ) ; var method = bool === 'or' ? 'orOn' : 'on' ; while ( ++ i < keys . length ) { this [ method ] ( keys [ i ] , first [ keys [ i ] ] ) ; } return this ; } else { data = [ bool , 'on' , first ] ; } break ; } case 2 : data = [ bool , 'on' , first , '=' , operator ] ; break ; default : data = [ bool , 'on' , first , operator , second ] ; } this . clauses . push ( data ) ; return this ; }
Adds an "on" clause to the current join object.
Adds an on clause to the current join object .