lib/map.js
function _mapArray(data, schema, options) {
    var base = [];
    if (data instanceof Array && options.keep) {
        base = _clone(data);
    }
    if (typeof data === 'object' && options.keep) {
        base = Object
            .keys(data)
            .map(function(key) {
                return data[key];
            });
    }
    return schema
        .reduce(function (memo, nestedSchema) {
            memo.push(_mapDataValue(data, nestedSchema));
            return memo;
        }, base);
}
function _mapArray(data, schema, options) {
    var base = [];
    if (data instanceof Array && options.keep) {
        base = _clone(data);
    }
    if (typeof data === 'object' && options.keep) {
        base = Object
            .keys(data)
            .map(function(key) {
                return data[key];
            });
    }
    return schema
        .reduce(function (memo, nestedSchema) {
            memo.push(_mapDataValue(data, nestedSchema));
            return memo;
        }, base);
}
function _mapArray ( data , schema , options ) { var base = [ ] ; if ( data instanceof Array && options . keep ) { base = _clone ( data ) ; } if ( typeof data === 'object' && options . keep ) { base = Object . keys ( data ) . map ( function ( key ) { return data [ key ] ; } ) ; } return schema . reduce ( function ( memo , nestedSchema ) { memo . push ( _mapDataValue ( data , nestedSchema ) ) ; return memo ; } , base ) ; }
Returns a new object with its new aspect from an array schema
@param data Object to map
@param schema Fields to map
@param options Options
@returns {*}
@private
Returns a new object with its new aspect from an array schema