lib/dynamodb/converter.js
function convertOutput(data, options) {
    options = options || {};
    var list, map, i;
    for (var type in data) {
      var values = data[type];
      if (type === 'M') {
        map = {};
        for (var key in values) {
          map[key] = convertOutput(values[key], options);
        }
        return map;
      } else if (type === 'L') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(convertOutput(values[i], options));
        }
        return list;
      } else if (type === 'SS') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(values[i] + '');
        }
        return new DynamoDBSet(list);
      } else if (type === 'NS') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(convertNumber(values[i], options.wrapNumbers));
        }
        return new DynamoDBSet(list);
      } else if (type === 'BS') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(new util.Buffer(values[i]));
        }
        return new DynamoDBSet(list);
      } else if (type === 'S') {
        return values + '';
      } else if (type === 'N') {
        return convertNumber(values, options.wrapNumbers);
      } else if (type === 'B') {
        return new util.Buffer(values);
      } else if (type === 'BOOL') {
        return (values === 'true' || values === 'TRUE' || values === true);
      } else if (type === 'NULL') {
        return null;
      }
    }
  }
function convertOutput(data, options) {
    options = options || {};
    var list, map, i;
    for (var type in data) {
      var values = data[type];
      if (type === 'M') {
        map = {};
        for (var key in values) {
          map[key] = convertOutput(values[key], options);
        }
        return map;
      } else if (type === 'L') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(convertOutput(values[i], options));
        }
        return list;
      } else if (type === 'SS') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(values[i] + '');
        }
        return new DynamoDBSet(list);
      } else if (type === 'NS') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(convertNumber(values[i], options.wrapNumbers));
        }
        return new DynamoDBSet(list);
      } else if (type === 'BS') {
        list = [];
        for (i = 0; i < values.length; i++) {
          list.push(new util.Buffer(values[i]));
        }
        return new DynamoDBSet(list);
      } else if (type === 'S') {
        return values + '';
      } else if (type === 'N') {
        return convertNumber(values, options.wrapNumbers);
      } else if (type === 'B') {
        return new util.Buffer(values);
      } else if (type === 'BOOL') {
        return (values === 'true' || values === 'TRUE' || values === true);
      } else if (type === 'NULL') {
        return null;
      }
    }
  }
function convertOutput ( data , options ) { options = options || { } ; var list , map , i ; for ( var type in data ) { var values = data [ type ] ; if ( type === 'M' ) { map = { } ; for ( var key in values ) { map [ key ] = convertOutput ( values [ key ] , options ) ; } return map ; } else if ( type === 'L' ) { list = [ ] ; for ( i = 0 ; i < values . length ; i ++ ) { list . push ( convertOutput ( values [ i ] , options ) ) ; } return list ; } else if ( type === 'SS' ) { list = [ ] ; for ( i = 0 ; i < values . length ; i ++ ) { list . push ( values [ i ] + '' ) ; } return new DynamoDBSet ( list ) ; } else if ( type === 'NS' ) { list = [ ] ; for ( i = 0 ; i < values . length ; i ++ ) { list . push ( convertNumber ( values [ i ] , options . wrapNumbers ) ) ; } return new DynamoDBSet ( list ) ; } else if ( type === 'BS' ) { list = [ ] ; for ( i = 0 ; i < values . length ; i ++ ) { list . push ( new util . Buffer ( values [ i ] ) ) ; } return new DynamoDBSet ( list ) ; } else if ( type === 'S' ) { return values + '' ; } else if ( type === 'N' ) { return convertNumber ( values , options . wrapNumbers ) ; } else if ( type === 'B' ) { return new util . Buffer ( values ) ; } else if ( type === 'BOOL' ) { return ( values === 'true' || values === 'TRUE' || values === true ) ; } else if ( type === 'NULL' ) { return null ; } } }
Convert a DynamoDB AttributeValue object to its equivalent JavaScript type.

@param data [map] An object in the Amazon DynamoDB AttributeValue format
@param options [map]
@option options convertEmptyValues [Boolean] Whether to automatically
convert empty strings, blobs,
and sets to `null`
@option options wrapNumbers [Boolean]  Whether to return numbers as a
NumberValue object instead of
converting them to native JavaScript
numbers. This allows for the safe
round-trip transport of numbers of
arbitrary size.

@return [Object|Array|String|Number|Boolean|null]

@see AWS.DynamoDB.Converter.unmarshall AWS.DynamoDB.Converter.unmarshall to
convert entire records (rather than individual attributes)
Convert a DynamoDB AttributeValue object to its equivalent JavaScript type .