dynamodb-utils.js
function toObjectFromDynamoDBMap(dynamoDBMap) {
  if (!dynamoDBMap || typeof dynamoDBMap !== 'object') {
    return dynamoDBMap;
  }
  const object = {};
  const keys = Object.getOwnPropertyNames(dynamoDBMap);
  for (let i = 0; i < keys.length; ++i) {
    const key = keys[i];
    object[key] = toValueFromAttributeValue(dynamoDBMap[key]);
  }
  return object;
}
function toObjectFromDynamoDBMap(dynamoDBMap) {
  if (!dynamoDBMap || typeof dynamoDBMap !== 'object') {
    return dynamoDBMap;
  }
  const object = {};
  const keys = Object.getOwnPropertyNames(dynamoDBMap);
  for (let i = 0; i < keys.length; ++i) {
    const key = keys[i];
    object[key] = toValueFromAttributeValue(dynamoDBMap[key]);
  }
  return object;
}
function toObjectFromDynamoDBMap ( dynamoDBMap ) { if ( ! dynamoDBMap || typeof dynamoDBMap !== 'object' ) { return dynamoDBMap ; } const object = { } ; const keys = Object . getOwnPropertyNames ( dynamoDBMap ) ; for ( let i = 0 ; i < keys . length ; ++ i ) { const key = keys [ i ] ; object [ key ] = toValueFromAttributeValue ( dynamoDBMap [ key ] ) ; } return object ; }
Attempts to convert the given DynamoDB map object containing keys and Attribute values into a JavaScript object.
@param {Object} dynamoDBMap - a DynamoDB map object with keys and AttributeValue values
@returns {Object} a JavaScript object
Attempts to convert the given DynamoDB map object containing keys and Attribute values into a JavaScript object .