npmtest-dynamodb-marshaler (v0.0.1)

Code coverage report for node-npmtest-dynamodb-marshaler/node_modules/dynamodb-marshaler/unmarshalItem.js

Statements: 80% (4 / 5)      Branches: 100% (0 / 0)      Functions: 0% (0 / 1)      Lines: 80% (4 / 5)      Ignored: none     

All files » node-npmtest-dynamodb-marshaler/node_modules/dynamodb-marshaler/ » unmarshalItem.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19    1 1                 1       1    
'use strict';
 
var ensureItemIsObject = require('./lib/ensureItemIsObject');
var unmarshal = require('./unmarshal');
 
/**
 * Translates a DynamoDb formatted object (a response from DynamoDb sdk) into
 * a plain javascript object with DynamoDb AttributeValue objects.
 *
 * @param {Object} item DynamoDb formatted object.
 * @returns {Object} A javascript object in normal form.
 */
function unmarshalItem(item) {
  return unmarshal({ M: item });
}
 
module.exports = ensureItemIsObject(unmarshalItem);