Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
params.RequestItems[process.env.ReplicaTable] = Object.keys(allRecords).map(function(key) {
var change = allRecords[key].pop();
if (change.eventName === 'INSERT' || change.eventName === 'MODIFY') {
return {
PutRequest: { Item: Dyno.deserialize(JSON.stringify(change.dynamodb.NewImage)) }
};
} else if (change.eventName === 'REMOVE') {
return {
DeleteRequest: { Key: Dyno.deserialize(JSON.stringify(change.dynamodb.Keys)) }
};
}
});
params.RequestItems[process.env.ReplicaTable] = Object.keys(allRecords).map(function(key) {
var change = allRecords[key].pop();
if (change.eventName === 'INSERT' || change.eventName === 'MODIFY') {
return {
PutRequest: { Item: Dyno.deserialize(JSON.stringify(change.dynamodb.NewImage)) }
};
} else if (change.eventName === 'REMOVE') {
return {
DeleteRequest: { Key: Dyno.deserialize(JSON.stringify(change.dynamodb.Keys)) }
};
}
});