aws-sdk-wrap
Advanced tools
Comparing version 13.2.1 to 13.2.2
@@ -22,10 +22,11 @@ import assert from 'assert'; | ||
.map(([k, v]) => [k, v.default]); | ||
const setDefaults = (item, toReturn) => { | ||
const setDefaults = (item, toReturn, unmarshall = false) => { | ||
const entries = toReturn === null ? defaults : defaults.filter(([k]) => toReturn.includes(k)); | ||
const data = entries.reduce( | ||
(prev, [k, v]) => Object | ||
.assign(prev, { [k]: clonedeep(typeof v === 'function' ? v(item) : v) }), | ||
{} | ||
); | ||
return { | ||
...entries.reduce( | ||
(prev, [k, v]) => Object | ||
.assign(prev, { [k]: clonedeep(typeof v === 'function' ? v(item) : v) }), | ||
{} | ||
), | ||
...(unmarshall === true ? model.unmarshall(data) : data), | ||
...item | ||
@@ -137,3 +138,3 @@ }; | ||
); | ||
const resultItem = setDefaults(mergedItem, null); | ||
const resultItem = setDefaults(mergedItem, null, true); | ||
if (['update', 'put'].includes(fn)) { | ||
@@ -140,0 +141,0 @@ await (didNotExist ? onCreate : onUpdate)(resultItem); |
{ | ||
"name": "aws-sdk-wrap", | ||
"type": "module", | ||
"version": "13.2.1", | ||
"version": "13.2.2", | ||
"description": "Wrapper around aws-sdk", | ||
@@ -6,0 +6,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
100167
2470