index.js
function normalize(args) {
  let result = {
    queries:  null,
    callback: null
  };

  if (args.length === 1 && Array.isArray(args[0])) {
    result.queries = args[0];
  } else if (args.length === 2 && Array.isArray(args[0])) {
    result.queries = args[0];

    if (typeof args[1] === 'function') {
      result.callback = args[1];
    }
  } else {
    result.queries = args;

    if (typeof result.queries[result.queries.length - 1] === 'function') {
      result.callback = result.queries.pop();
    }
  }

  return result;
}
function normalize(args) {
  let result = {
    queries:  null,
    callback: null
  };

  if (args.length === 1 && Array.isArray(args[0])) {
    result.queries = args[0];
  } else if (args.length === 2 && Array.isArray(args[0])) {
    result.queries = args[0];

    if (typeof args[1] === 'function') {
      result.callback = args[1];
    }
  } else {
    result.queries = args;

    if (typeof result.queries[result.queries.length - 1] === 'function') {
      result.callback = result.queries.pop();
    }
  }

  return result;
}
function normalize ( args ) { let result = { queries : null , callback : null } ; if ( args . length === 1 && Array . isArray ( args [ 0 ] ) ) { result . queries = args [ 0 ] ; } else if ( args . length === 2 && Array . isArray ( args [ 0 ] ) ) { result . queries = args [ 0 ] ; if ( typeof args [ 1 ] === 'function' ) { result . callback = args [ 1 ] ; } } else { result . queries = args ; if ( typeof result . queries [ result . queries . length - 1 ] === 'function' ) { result . callback = result . queries . pop ( ) ; } } return result ; }
Normalizes arguments passed to any of the pga methods that handle multiple
queries- parallel or transact.
@param  {Array} args [description]
@return {Object}
@private
Normalizes arguments passed to any of the pga methods that handle multiple queries - parallel or transact .