Skip to content

Commit e833474

Browse files
committed
Fix parens.
1 parent bcd5172 commit e833474

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/sinks/dynamodb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const ifNotExists = (value) => ({
192192
__isResolver__: true,
193193
resolvedValue: value,
194194
top: (attributeKey) => `if_not_exists(#${attributeKey}, :${attributeKey})`,
195-
nested: (attributeKey) => `if_not_exists(${attributeKey.split('.').map((ak) => `#${ak}`).join('.')}), :${attributeKey}`,
195+
nested: (attributeKey) => `if_not_exists(${attributeKey.split('.').map((ak) => `#${ak}`).join('.')}, :${attributeKey})`,
196196
});
197197

198198
export const incrementBy = (value) => ({
@@ -212,7 +212,7 @@ export const decrementBy = (value) => ({
212212
export const append = (value) => ({
213213
__isResolver__: true,
214214
resolvedValue: [].concat(value),
215-
top: (attributeKey) => `list_append(#${attributeKey}, :${attributeKey}`,
215+
top: (attributeKey) => `list_append(#${attributeKey}, :${attributeKey})`,
216216
nested: (attributeKey) => `list_append(${attributeKey.split('.').map((ak) => `#${ak}`).join('.')}, :${attributeKey})`,
217217
});
218218

test/unit/sinks/dynamodb.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ describe('sinks/dynamodb.js', () => {
431431
':listAttributeB': [7, 8, 9],
432432
':list.nested.prepend': [10, 11, 12],
433433
},
434-
'UpdateExpression': 'SET #createdAt = if_not_exists(#createdAt, :createdAt), #obj.#nested.#createdAt = if_not_exists(#obj.#nested.#createdAt), :obj.nested.createdAt, #incrementValue = #incrementValue + :incrementValue, #obj.#increment.#value = #obj.#increment.#value + :obj.increment.value, #decrementValue = #decrementValue - :decrementValue, #obj.#decrement.#value = #obj.#decrement.#value - :obj.decrement.value, #listAttributeA = list_append(#listAttributeA, :listAttributeA, #list.#nested.#append = list_append(#list.#nested.#append, :list.nested.append), #listAttributeB = list_append(:listAttributeB, #listAttributeB), #list.#nested.#prepend = list_append(:list.nested.prepend, #list.#nested.#prepend)',
434+
'UpdateExpression': 'SET #createdAt = if_not_exists(#createdAt, :createdAt), #obj.#nested.#createdAt = if_not_exists(#obj.#nested.#createdAt, :obj.nested.createdAt), #incrementValue = #incrementValue + :incrementValue, #obj.#increment.#value = #obj.#increment.#value + :obj.increment.value, #decrementValue = #decrementValue - :decrementValue, #obj.#decrement.#value = #obj.#decrement.#value - :obj.decrement.value, #listAttributeA = list_append(#listAttributeA, :listAttributeA), #list.#nested.#append = list_append(#list.#nested.#append, :list.nested.append), #listAttributeB = list_append(:listAttributeB, #listAttributeB), #list.#nested.#prepend = list_append(:list.nested.prepend, #list.#nested.#prepend)',
435435
'ReturnValues': 'ALL_NEW',
436436
});
437437
});

0 commit comments

Comments
 (0)