Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. // ...
  2. const getModule = (config) => {
  3. const documentClient = new AWS.DynamoDB.DocumentClient(config)
  4.  
  5. return ({
  6. // ...
  7. getByPK: (params, attributes = undefined) =>
  8. documentClient
  9. .get(
  10. mergedParams(params, attributes ? projectionExpression(attributes) : {})
  11. )
  12. .promise()
  13. .then(data => (Object.keys(data).length ? data.Item : undefined))
  14. })
  15. }
  16. // ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement