Skip to content

Commit f314ef2

Browse files
committed
Improve equalsHelper
1 parent dd2a825 commit f314ef2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ function Postgres(url, options) {
405405
}
406406

407407
function equalsHelper(first, columns, xargs, types) {
408-
return columns.length ? columns : Object.keys(first).reduce((acc, [k, v]) =>
409-
acc + (acc ? ',' : '') + escape(k) + ' = ' + parseValue(v, xargs, types)
408+
return (columns.length ? columns : Object.keys(first)).reduce((acc, k) =>
409+
acc + (acc ? ',' : '') + escape(k) + ' = ' + parseValue(first[k], xargs, types)
410410
, '')
411411
}
412412

0 commit comments

Comments
 (0)