@@ -444,8 +444,9 @@ function Postgres(a, b) {
444444 acc + ( ! columns . length || columns . indexOf ( k ) > - 1
445445 ? ( acc ? ',' : '' ) + parseValue ( v , xargs , types ) + ' as ' + escape ( k )
446446 : ''
447- )
448- , '' )
447+ ) ,
448+ ''
449+ )
449450 }
450451
451452 function insertHelper ( first , columns , xargs , types ) {
@@ -455,14 +456,16 @@ function Postgres(a, b) {
455456 first . reduce ( ( acc , row ) =>
456457 acc + ( acc ? ',' : '' ) + '(' +
457458 columns . reduce ( ( acc , k ) => acc + ( acc ? ',' : '' ) + parseValue ( row [ k ] , xargs , types ) , '' ) +
458- ')'
459- , '' )
459+ ')' ,
460+ ''
461+ )
460462 }
461463
462464 function equalsHelper ( first , columns , xargs , types ) {
463465 return ( columns . length ? columns : Object . keys ( first ) ) . reduce ( ( acc , k ) =>
464- acc + ( acc ? ',' : '' ) + escape ( k ) + ' = ' + parseValue ( first [ k ] , xargs , types )
465- , '' )
466+ acc + ( acc ? ',' : '' ) + escape ( k ) + ' = ' + parseValue ( first [ k ] , xargs , types ) ,
467+ ''
468+ )
466469 }
467470
468471 function escapeHelper ( xs ) {
@@ -476,8 +479,8 @@ function Postgres(a, b) {
476479 return Array . isArray ( x )
477480 ? x . reduce ( ( acc , x ) => acc + ( acc ? ',' : '' ) + addValue ( x , xargs , types ) , '' )
478481 : x && x . P === notPromise . P
479- ? parseArg ( '' , x , xargs , types )
480- : addValue ( x , xargs , types )
482+ ? parseArg ( '' , x , xargs , types )
483+ : addValue ( x , xargs , types )
481484 }
482485
483486 function addValue ( x , xargs , types ) {
@@ -523,8 +526,8 @@ function parseOptions(a, b) {
523526 max : o . max || url . query . max || 10 ,
524527 types : o . types || { } ,
525528 ssl : o . ssl || url . ssl || false ,
526- idle_timeout : o . idle_timeout || url . query . idle_timeout || env . PGIDLE_TIMEOUT || warn ( o . timeout , 'The timeout option is deprecated, use idle_timeout instead' ) ,
527- connect_timeout : o . connect_timeout || url . query . connect_timeout || env . PGCONNECT_TIMEOUT || 30 ,
529+ idle_timeout : o . idle_timeout || url . query . idle_timeout || env . PGIDLE_TIMEOUT || warn ( o . timeout ) ,
530+ connect_timeout : o . connect_timeout || url . query . connect_timeout || env . PGCONNECT_TIMEOUT || 30 ,
528531 onnotice : o . onnotice ,
529532 onparameter : o . onparameter ,
530533 transform : Object . assign ( { } , o . transform ) ,
@@ -535,8 +538,8 @@ function parseOptions(a, b) {
535538 )
536539}
537540
538- function warn ( x , message ) {
539- typeof x !== 'undefined' && console . log ( message )
541+ function warn ( x ) {
542+ typeof x !== 'undefined' && console . log ( 'The timeout option is deprecated, use idle_timeout instead' ) // eslint-disable-line
540543 return x
541544}
542545
0 commit comments