Comparing version 1.0.4 to 1.0.5
@@ -22,4 +22,8 @@ "use strict"; | ||
.filter(key => key !== 'created'); | ||
const updateExpression = fieldNames.map(key => `${key}=:${key}`) | ||
const updateExpression = fieldNames.map(key => `#${key}=:${key}`) | ||
.join(', '); | ||
const updateExpressionAttributeNames = fieldNames.reduce((obj, key) => { | ||
obj[`#${key}`] = key; | ||
return obj; | ||
}, {}); | ||
const updateExpressionAttributeValues = fieldNames.reduce((obj, key) => { | ||
@@ -42,2 +46,3 @@ obj[`:${key}`] = updatedItem[key]; | ||
UpdateExpression: `set ${updateExpression}`, | ||
ExpressionAttributeNames: updateExpressionAttributeNames, | ||
ExpressionAttributeValues: expressionAttributeValues, | ||
@@ -44,0 +49,0 @@ ReturnValues: 'ALL_NEW' |
{ | ||
"name": "cruft-ddb", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A simple optimistic-locking abstraction over Dynamo DB", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
129570
784