Skip to content

Commit 74337f9

Browse files
committed
refactor: format code
1 parent 7b2efec commit 74337f9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/update.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ function setToSQL(sets) {
1414
let str = ''
1515
const { table, column, value, keyword } = set
1616
str = [table, column].filter(hasVal).map(info => identifierToSql(info)).join('.')
17-
if (value) {
18-
const prefix = keyword && `${toUpper(keyword)}(` || ''
19-
const suffix = keyword && ')' || ''
20-
str = `${str} = ${prefix}${exprToSQL(value)}${suffix}`
17+
let prefix = ''
18+
let suffix = ''
19+
if (keyword) {
20+
prefix = `${toUpper(keyword)}(`
21+
suffix = ')'
2122
}
23+
if (value) str = `${str} = ${prefix}${exprToSQL(value)}${suffix}`
2224
clauses.push(str)
2325
}
2426
return clauses.join(', ')

0 commit comments

Comments
 (0)