@xapp/dynamo-service
Advanced tools
Comparing version 0.0.36 to 0.0.37
@@ -17,3 +17,3 @@ "use strict"; | ||
update(table, key, update, conditionOrReturns = "NONE", returns = "NONE") { | ||
const updateExpression = getUpdateParameters(update); | ||
const updateExpression = getUpdateParameters(transferUndefinedToRemove(update)); | ||
const conditionExpression = (typeof conditionOrReturns === "object") ? conditionOrReturns : {}; | ||
@@ -183,1 +183,16 @@ const ReturnValues = (typeof conditionOrReturns === "object") ? returns : conditionOrReturns; | ||
} | ||
function transferUndefinedToRemove(body) { | ||
const set = Object.assign({}, body.set); | ||
const remove = (body.remove || []).slice(); | ||
const setKeys = Object.keys(set); | ||
for (const key of setKeys) { | ||
const item = set[key]; | ||
if (!item) { | ||
if (typeof item !== typeof true && item !== 0) { | ||
remove.push(key); | ||
delete set[key]; | ||
} | ||
} | ||
} | ||
return Object.assign({}, body, { set, remove }); | ||
} |
{ | ||
"name": "@xapp/dynamo-service", | ||
"version": "0.0.36", | ||
"version": "0.0.37", | ||
"description": "A dynamo help class which will help maintain data integrity.", | ||
@@ -5,0 +5,0 @@ "main": "dist/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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
119046
3234