lib/builder.js
function union(callbacks, wrap) {
    if (arguments.length === 1 || arguments.length === 2 && typeof wrap === 'boolean') {
      if (!Array.isArray(callbacks)) {
        callbacks = [callbacks];
      }
      for (var i = 0, l = callbacks.length; i < l; i++) {
        this._statements.push({
          grouping: 'union',
          clause: 'union',
          value: callbacks[i],
          wrap: wrap || false
        });
      }
    } else {
      callbacks = normalizeArr.apply(null, arguments).slice(0, arguments.length - 1);
      wrap = arguments[arguments.length - 1];
      if (typeof wrap !== 'boolean') {
        callbacks.push(wrap);
        wrap = false;
      }
      this.union(callbacks, wrap);
    }
    return this;
  }
function union(callbacks, wrap) {
    if (arguments.length === 1 || arguments.length === 2 && typeof wrap === 'boolean') {
      if (!Array.isArray(callbacks)) {
        callbacks = [callbacks];
      }
      for (var i = 0, l = callbacks.length; i < l; i++) {
        this._statements.push({
          grouping: 'union',
          clause: 'union',
          value: callbacks[i],
          wrap: wrap || false
        });
      }
    } else {
      callbacks = normalizeArr.apply(null, arguments).slice(0, arguments.length - 1);
      wrap = arguments[arguments.length - 1];
      if (typeof wrap !== 'boolean') {
        callbacks.push(wrap);
        wrap = false;
      }
      this.union(callbacks, wrap);
    }
    return this;
  }
function union ( callbacks , wrap ) { if ( arguments . length === 1 || arguments . length === 2 && typeof wrap === 'boolean' ) { if ( ! Array . isArray ( callbacks ) ) { callbacks = [ callbacks ] ; } for ( var i = 0 , l = callbacks . length ; i < l ; i ++ ) { this . _statements . push ( { grouping : 'union' , clause : 'union' , value : callbacks [ i ] , wrap : wrap || false } ) ; } } else { callbacks = normalizeArr . apply ( null , arguments ) . slice ( 0 , arguments . length - 1 ) ; wrap = arguments [ arguments . length - 1 ] ; if ( typeof wrap !== 'boolean' ) { callbacks . push ( wrap ) ; wrap = false ; } this . union ( callbacks , wrap ) ; } return this ; }
Add a union statement to the query.
Add a union statement to the query .