index.js
function multiple(pool, fn, queries, callback) {
  let queryObjects = queries.map(query => {
    if (typeof query === 'string') {
      return { text: query, values: [] };
    }

    return Object.assign({ values: [] }, query);
  });

  if (callback && typeof callback === 'function') {
    return fn(pool, queryObjects, callback);
  }

  return new Promise((resolve, reject) => {
    fn(pool, queryObjects, (error, result) => {
      if (error) {
        return reject(error);
      }

      resolve(result);
    });
  });
}
function multiple(pool, fn, queries, callback) {
  let queryObjects = queries.map(query => {
    if (typeof query === 'string') {
      return { text: query, values: [] };
    }

    return Object.assign({ values: [] }, query);
  });

  if (callback && typeof callback === 'function') {
    return fn(pool, queryObjects, callback);
  }

  return new Promise((resolve, reject) => {
    fn(pool, queryObjects, (error, result) => {
      if (error) {
        return reject(error);
      }

      resolve(result);
    });
  });
}
function multiple ( pool , fn , queries , callback ) { let queryObjects = queries . map ( query => { if ( typeof query === 'string' ) { return { text : query , values : [ ] } ; } return Object . assign ( { values : [ ] } , query ) ; } ) ; if ( callback && typeof callback === 'function' ) { return fn ( pool , queryObjects , callback ) ; } return new Promise ( ( resolve , reject ) => { fn ( pool , queryObjects , ( error , result ) => { if ( error ) { return reject ( error ) ; } resolve ( result ) ; } ) ; } ) ; }
Using the specified connection pool, performs the specified function using
a series of queries and a user-defined callback function.
@param  {BoundPool}      pool
@param  {Function}       fn
@param  {Array.<Object>} queries
@param  {Function}       callback
@return {Promise}
@private
Using the specified connection pool performs the specified function using a series of queries and a user - defined callback function .