Skip to content

Commit c7e352a

Browse files
committed
fix: broken ternary into ifs
1 parent 680e6ec commit c7e352a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,11 @@ function Postgres(a, b) {
320320
}
321321

322322
function join(sep, xs) {
323-
return xs.flatMap((x, i) => i ? Array.isArray(x) ? [sep, ...x] : [sep, x])
323+
return xs.flatMap((x, i) => {
324+
if (i === 0) return x
325+
if (Array.isArray(x)) return [sep, ...x]
326+
return [sep, x]
327+
})
324328
}
325329

326330
function array(x, type) {

0 commit comments

Comments
 (0)